Advertisement

Base64 Decoder

Decode Base64 or Base64URL back to readable UTF-8 text or hex bytes. Accepts data URIs, line breaks and missing padding, and explains bad input.

Paste Base64 to see what it contains. The decoder accepts the standard and URL-safe alphabets, ignores line breaks, works with or without "=" padding and strips a data:...;base64, prefix. The bytes are shown as UTF-8 text when they are text, or as hex when they are binary, and malformed input gets a specific explanation rather than garbage output.

How to use this tool

  1. Paste the Base64 string, a single JWT segment, or a whole data URI.
  2. Read the decoded text, which updates as you type.
  3. Switch Show the result as to hex to inspect the raw bytes.
  4. For images, PDFs and other files, use Base64 to File to download them.

Formula

bytes = ⌊6 × c ÷ 8⌋

c is the number of Base64 characters, not counting "=" padding. Each character carries 6 bits; the bits are regrouped into 8-bit bytes, and the 2 or 4 spare bits at the very end are dropped (in canonical Base64 they are zero). A length that leaves a single character over is impossible and means the text was cut off.

Example

dGVzdDoxMjPCow== has 14 characters before the padding, so it holds ⌊6 × 14 ÷ 8⌋ = 10 bytes. Read as UTF-8 they spell test:123£: eight ASCII characters plus the pound sign, which takes two bytes (C2 A3). It is the UTF-8 credentials example from RFC 7617.

Frequently asked questions

Why do I get hex instead of text?

The bytes are invalid UTF-8 or contain control characters, so this tool shows hex instead. Valid text can contain controls too; this display choice does not identify a file type. Base64 to File can save the bytes.

Can it decode JWTs?

Yes, one part at a time. A JSON Web Token is three URL-safe Base64 segments joined by dots; paste the first or second segment to read its JSON header or payload. Decoding does not verify the signature.

What makes Base64 invalid?

Characters outside A–Z, a–z, 0–9, + / (or - _), "=" anywhere but the end, mixing both alphabets, or a length that leaves one character over — usually a sign the string was cut off when copying.

Is decoding the same as decrypting?

No. Base64 has no key, so decoding only reverses the encoding. If the result looks like random bytes, the data was probably encrypted or compressed before being encoded.

Sources

Last updated: 2026-10-30

Advertisement