Format Code Now
/

Base64 to Hex Converter

ED-19

Paste a Base64 or Base64URL string to see its bytes as hex. Padding is optional, and an invalid character is reported with its line and column.

Runs in your browser. Nothing is uploaded.

Base64 or Base64URL

Hex

How to use it

  1. Paste the Base64 or Base64URL string into the input box.
  2. Pick lowercase or uppercase letters, a separator between bytes, and whether to add 0x in front of each byte.
  3. Click Convert to hex. The result updates as you change options.
  4. Copy the hex, or download it as a .txt file.

Which Base64 it accepts

Both common alphabets work. Standard Base64 uses + and /, while the URL-safe form used in JWTs and links uses - and _. The tool works out which one you have, and refuses input that mixes the two. The = padding at the end is optional, and spaces and line breaks are ignored, so you can paste a wrapped block from an email or a certificate body.

What counts as an error

Any character outside the alphabet is reported with its line and column. So is data after the padding, more than two = signs, padding that does not fit the length, and a length that leaves one stray character, which cannot hold a whole byte. The few spare bits at the end of the last character are not checked, so Base64 that is not strictly canonical is still converted.

Reading the hex output

The output is the raw bytes, two hex digits per byte. You can write them in lowercase or uppercase, join them with nothing, a space or a colon, and add 0x in front of each byte. The tool does not guess whether the bytes are text, an image or a key. If you expect text, run the hex through a hex-to-text converter.

Error messages and what to do

MessageWhat it meansFix
Invalid Base64 characterA character is not in the Base64 or Base64URL alphabet.Fix the character at the line and column shown, or remove stray text around the string.
mixes the standard alphabetThe input uses + or / together with - or _.Convert all of the string to one alphabet before pasting it.
Data after the "=" paddingA character follows the = signs that end Base64 data.Remove what comes after the padding, or split joined strings.
which cannot be validThe number of Base64 characters leaves a single character over, which holds no full byte.The string is probably cut off; copy it again in full.

Questions people ask

How do I convert Base64 to hex?

Paste the Base64 into the box and click Convert to hex. The tool decodes it to bytes and writes each byte as two hex digits. For example SGVsbG8= becomes 48656c6c6f. Choose a separator if you want the bytes spaced out.

Does it work with Base64URL?

Yes. Strings that use - and _ instead of + and / are decoded the same way, with or without = padding. The only thing it rejects is a string that uses both alphabets at once, since that cannot be valid in either one.

Do I need the = padding?

No. Padding is optional here. If you include it, it has to be consistent with the length of the data, and nothing may follow it. A string that is the wrong length even without padding gives an error.

How do I get hex with a colon between bytes?

Set Between bytes to Colon. The output then looks like 48:65:6c, which is the form many tools show for fingerprints and serial numbers. Use Uppercase letters for the A to F style, and tick the 0x box if you need a prefix.

Why is my hex output not readable text?

Base64 often holds binary data such as keys, hashes or compressed content, and those bytes are not text. The tool only shows the bytes in hex. It does not try to interpret them, so you will see the same bytes whatever they mean.

Is the Base64 I paste uploaded?

No. Decoding happens in your browser, so the string you paste, which may be a token or a key, never leaves the page. The tool makes no network calls and needs no account, and Share links keep the input after the # in the address.

About this tool

Reads standard Base64 (+ and /) and the URL-safe form (- and _). Padding with = is optional, and spaces and line breaks are ignored. Mixing the two alphabets, a bad character, data after the padding, or a length that cannot be valid gives an error with the position. The few unused bits at the end of the last character are not checked, so slightly non-canonical Base64 is accepted. The result is the raw bytes as hex; the tool does not try to read them as text or as a file type.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.