Base64 to Hex

Convert Base64 to hexadecimal bytes and back.

The Base64 to Hex tool converts binary data between its Base64 text form and its hexadecimal form. It decodes standard and URL-safe Base64 and encodes hex back to Base64, with options for grouping and letter case. It is handy when you move keys, hashes, signatures or IDs between systems that print them differently.

What are Base64 and hex?

Base64 and hexadecimal are two ways of writing the same bytes as printable text. Hex uses two characters (0-9, a-f) per byte, so the output is exactly twice as long as the data. Base64 packs three bytes into four characters from an alphabet of letters, digits, plus and slash, which makes it about 33 percent larger than the data. The URL-safe variant in RFC 4648 swaps plus and slash for hyphen and underscore and usually drops the trailing equals padding. Converting between them does not change the bytes, only how they are written, so the tool does not interpret the data as text. Hex is easier to read and compare by eye, while Base64 is more compact in JSON, headers and configuration files.

How to use Base64 to Hex

  1. Pick the direction Choose Base64 to Hex or Hex to Base64 using the two buttons above the text boxes.
  2. Paste your value Paste the Base64 or hex string into the Input box. The Output box fills in automatically.
  3. Set the options Choose Hex grouping (None, Space or Colon), tick Uppercase hex if needed, and tick URL-safe Base64 (hex to Base64) when you need the URL-safe alphabet.
  4. Copy the result Use the copy or download controls on the Output box to take the converted value.

Frequently asked questions

Does this change the data?

No. Both forms describe the same bytes. Only the text representation changes.

Can it decode URL-safe Base64?

Yes. Base64 to Hex accepts both the standard alphabet and the URL-safe one (hyphen and underscore), with or without padding.

Why is the hex output twice as long as the data?

Each byte is written as two hex digits. Base64 uses roughly four characters for every three bytes.

Is the output interpreted as text?

No. The tool works on raw bytes. If the bytes are UTF-8 text, use a Base64 text decoder to see the characters.

Is my input sent anywhere?

No. The conversion runs in the page and the input is not sent to a server.