Convert Base64 to Hex

Paste Base64 to decode it into hexadecimal — with the exact byte count and your choice of compact or spaced, upper- or lowercase output.

Input — Base64○ Waiting for input

Nothing to convert yet

Nothing to convert yet — paste your data or drop a file to begin.

Your files and data stay in your browser.

Inspection Report

Result metadata
Detected Type
MIME Type
Encoding
Input Length
Decoded Size
Padding Status
Data URI
File Signature
Preview Availability

How to convert Base64 to Hex

To convert Base64 to hex, paste the Base64 string into the tool above. It validates and decodes the data, reports the exact number of bytes, and shows the result as hexadecimal — compact or spaced by byte, uppercase or lowercase. The conversion runs entirely in your browser, and you can copy the hex with one click.

How to Use

  1. Paste the Base64 string into the input box.
  2. The tool validates the input; if padding is missing or URL-safe characters appear, use the one-click fix.
  3. Read the byte count in the inspector to confirm the decoded size.
  4. Choose your format: compact (89504e47...) or spaced (89 50 4e 47...), uppercase or lowercase.
  5. Click Copy. To go back, use the Hex to Base64 tool.

Real Example

The Base64 string SGVsbG8= decodes to the five bytes 48 65 6c 6c 6f — the ASCII text "Hello" — and the inspector reports Decoded Size: 5 bytes. A PNG's Base64 start iVBORw0KGgo becomes 89 50 4e 47 0d 0a 1a 0a, which is exactly the eight-byte PNG file signature. Seeing data as hex makes signatures, headers and byte patterns visible in a way Base64 never does.

Code Snippets

// Base64 to spaced uppercase hex (browser) const bytes = Uint8Array.from(atob(base64), c => c.charCodeAt(0)); const hex = [...bytes].map(b => b.toString(16).padStart(2, '0')).join(' ').toUpperCase();

How Base64 to Hex Works

Hexadecimal is the most readable way to look at raw bytes: each byte becomes exactly two characters, 00 through ff. That one-to-two mapping is why developers reach for hex when inspecting file signatures, packet captures, hashes and binary protocols. This tool decodes Base64 to bytes first, so validation problems are caught before you ever see hex, and the byte count tells you the true size of the decoded data. Spaced output groups bytes visually for reading; compact output is what most tools and documentation expect when pasting.

Common Use Cases

  • Inspecting file signatures and binary headers inside Base64 payloads.
  • Comparing decoded data against a hex dump from another tool.
  • Checking hashes, keys or identifiers that travel as Base64.
  • Debugging binary protocols that mix Base64 transport with hex documentation.

FAQ

What does the byte count tell me?
It is the exact number of bytes your Base64 decodes to. It lets you confirm the data size before you use the hex — for example, checking that a hash really is 32 bytes long.
What is the difference between spaced and compact hex output?
Spaced output puts a space between bytes (48 65 6c 6c 6f) for readability; compact output has no separators (48656c6c6f), which is what most tools expect when you paste hex.
Why convert Base64 to hex instead of decoding to a file?
Because hex keeps binary data readable as text. It is the right view when you want to inspect bytes — signatures, headers, keys — rather than open a file.
Is the hex output uppercase or lowercase by default?
Lowercase compact is the default, matching the convention of most programming tools. You can switch to uppercase or spaced formatting with one click.

Related Tools