Input

Mode:

Output

What Is Base64 to Hex?

Base64 and hexadecimal are both ways of representing binary data as text, but they serve different audiences. Base64 (RFC 4648) is compact and common in APIs, JWTs, and data URIs. Hex is human-readable and the go-to format for debugging binary data, inspecting byte sequences, or working with cryptographic hashes. This tool converts between the two: paste a Base64 string and get space-separated hex bytes back, or paste hex and get Base64. The conversion is handled on the page with atob() and typed arrays, so nothing is uploaded anywhere.

Toggle between Decode (Base64 → Hex) and Encode (Hex → Base64) using the mode buttons. Either way the bytes are worked out by this page in your browser, and nothing you paste is sent off to a server.

How to Use This Tool

1

Choose Mode

Pick Decode when you have Base64 and want to look at the actual bytes, or Encode when you have a hex dump (from xxd, Wireshark or a hash function) that has to travel as Base64.

2

Paste Input

Paste into the left editor. In Encode mode spaces and line breaks between pairs are ignored, so 89 50 4e 47 and 89504e47 give the same Base64. Sample fills in a short greeting for the active mode, and Upload reads a .txt or .hex file that holds the text.

3

Copy or Download Result

A moment after your last keystroke the right panel lists the bytes as lowercase pairs with a space between each one. Copy puts them on the clipboard, and Download saves decoded.hex (or encoded.txt when you are encoding).

Example

Decoding a Base64 string to its hex representation byte-by-byte:

Base64 Input

Input

Hex Output

Output

Frequently Asked Questions

How does Base64 to hex decoding work?

The Base64 string is first decoded to raw binary using the browser's built-in atob() function. Each resulting byte is then converted to its two-digit hexadecimal representation. For example, the ASCII character H (decimal 72) becomes 48 in hex.

Can I paste a Data URI (data:...;base64,...) instead of raw Base64?

Yes. The tool automatically strips the data: prefix and MIME type so you can paste a full Data URI directly. Only the Base64 payload after the comma is decoded.

What hex format does the output use?

Each byte is output as a lowercase two-digit hex value, separated by spaces (e.g., 48 65 6c 6c 6f). This is the standard format used by hex editors and most debugging tools. Spaces are stripped automatically when encoding back from hex.

Does this tool support URL-safe Base64 (Base64url)?

The browser's atob() expects standard Base64. If your string uses - and _ instead of + and /, use our Base64 URL Decoder first, or replace the characters manually before pasting.

Is my data private when using this tool?

Completely. Base64 and hex are just two spellings of the same bytes, and translating between them is done by JavaScript in this tab. Keep the Network tab in DevTools open while you convert and you'll see no outbound requests.

Why does encoding fail with odd-length or invalid hex?

Hex strings must have an even number of characters (each byte needs two hex digits). The encoder validates the input and rejects anything that contains non-hex characters or has an odd length. Strip any 0x prefixes or colons before pasting.

Related Tools

The 64-character alphabet and the = padding rule come from section 4 of RFC 4648. Wikipedia's hexadecimal article has a table of nibble values if you are reading dumps by hand, and MDN's Base64 glossary entry covers the atob() and btoa() pair this page calls.