About this tool
Convert hexadecimal strings into Base64 and back.
The Hex to Base64 converter rewrites the same bytes from hexadecimal into Base64 and back, using the alphabets defined in RFC 4648 — 4 bits per hex character, 6 bits per Base64 character. Paste a hex dump with spaces, colons or 0x prefixes and it strips the formatting, decodes to raw bytes, then re-encodes in standard or URL-safe Base64. It is aimed at developers moving keys, hashes, certificates and binary blobs between tools that disagree on encoding.
Open Hex to Base64 on AltFTool — it loads instantly in your browser.
Pick a direction — Hex → Base64 or Base64 → Hex — and paste into the box; spaces, colons and 0x prefixes in hex input are stripped before decoding.
For Base64 output tick "URL-safe alphabet (- and _)" or "Keep = padding"; for hex output tick "Uppercase hex" or "Space every byte".
Read the converted string with its byte count, the same data sized as hex and as Base64, how many characters Base64 saves, and the UTF-8 decoding, then press Copy result.
Spaces, colons, dashes and 0x prefixes are stripped before decoding, so hex dumps paste straight in.
Switch between standard (+ /) and URL-safe (- _) Base64, with padding on or off.
Conversion happens in the browser, so keys and hashes never leave the device.
Decode the hex to bytes — two hex digits per byte — then re-encode those bytes in groups of three as four Base64 characters. Hex 4d616e is the three bytes 77, 97, 110, which encode to TWFu.
Base64 carries 6 bits per character against hex's 4, so it needs about 33% more characters than raw bytes while hex needs 100% more. A 32-byte hash is 64 hex characters but only 44 Base64 characters including padding.
They pad the output to a multiple of four characters. One leftover byte produces two characters plus '==', two leftover bytes produce three characters plus '='. Decoders accept the string without padding too, which is why the pad toggle exists.
The RFC 4648 §5 alphabet, which replaces + with - and / with _ so the string survives being placed in a URL path or query without percent-encoding. The bytes are identical; only two characters differ.
Add the Hex to Base64 widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/hex-to-base64"
title="Hex to Base64 — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/hex-to-base64?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>