How to use the Base64 to hex converter
- Set Direction to Base64 → hex or Hex → Base64.
- Paste the value into Input.
- For Base64 to hex, choose the Hex output style: 48 65 6c (spaced) or 48656c (compact).
- Copy the result.
What it does and when to use it
This is a converter between two ways of writing the same bytes. It does not interpret the bytes as text, so it works for binary values such as:
- A SHA-256 or SHA-512 digest, to compare an
integrity="sha256-…"value with a hash printed in hex. - An HMAC or signature returned by an API in Base64, to check it against your own hex output.
- A key, salt or IV that one library prints in hex and another expects in Base64.
To see the bytes with offsets and a text column, use the hex dump viewer, which also accepts Base64. If the Base64 contains readable text, the Base64 decoder shows it directly. For hashing data in the first place, try the SHA-256 hash generator.
How it works
Both directions go through raw bytes, following RFC 4648 for Base64 and Base16 (hex):
- Base64 → hex: whitespace and padding are removed, - and _ are mapped to + and /, and each group of 4 characters becomes 3 bytes. Each byte is then printed as two lowercase hex digits.
- Hex → Base64: separators and prefixes are removed, each pair of digits becomes a byte, and the bytes are Base64-encoded with = padding.
Invalid characters are reported with their position. Nothing leaves your browser.
Worked examples
SGVsbG8= → 48 65 6c 6c 6f
SGVsbG8sIFRvb2xzUmlmdCE= (compact) → 48656c6c6f2c20546f6f6c735269667421
3q2-7w (URL-safe, no padding) → de ad be ef
0x48 0x65 0x6c 0x6c 0x6f (Hex → Base64) → SGVsbG8=
de ad be ef (Hex → Base64) → 3q2+7w==
The third and last lines are a round trip: the URL-safe 3q2-7w and the standard 3q2+7w== are the same four bytes.
Limits and tips
- Hex output is always lowercase. Most tools compare hex case-insensitively, but a plain text comparison may not.
- When comparing a hash, make sure both sides hashed exactly the same bytes, including line endings.
- For converting text to hex, rather than Base64 to hex, use Text to Hex.
Frequently asked questions
Why would I convert Base64 to hex?
Which hex formats can I paste?
Does it accept URL-safe Base64?
Why is the hex twice as long as the bytes?
Does converting change the data?
Sources
- RFC 4648: The Base16, Base32, and Base64 Data Encodings — IETF / RFC Editor, accessed 2026-10-08
How do we know nothing is uploaded? Test it yourself on the privacy proof page.