Choose language

Base64 Decode

Decode any Base64 string back to readable text instantly. Handles UTF-8 output, ignores stray whitespace, and runs fully in your browser.

Mehmet Demiray Published Updated
Share

How Base64 Decoding Works

Decoding reverses Base64 encoding. The encoder mapped each group of 3 input bytes onto 4 printable characters drawn from A-Z, a-z, 0-9, +, and /. Decoding walks that path backward: it reads four characters at a time, looks up each one in the 64-character table to recover six bits, and reassembles those bits into the original bytes.

The trailing = characters are padding markers, not data. They tell the decoder how many real bytes the final group held, so it can trim the output correctly. A string ending in == decodes to one byte in its last group, while a single = means two bytes.

For example, SGk= decodes to Hi. Because decoding is fully deterministic, a valid Base64 string always returns the exact bytes that were encoded. If you need to go the other direction, use Base64 Encode to encode fresh text.

Turning Decoded Bytes Into Readable Text

Base64 decoding gives you raw bytes, and those bytes still need a character encoding to become text. This tool interprets the result as UTF-8, the modern standard, so accented letters, symbols, and emoji come through correctly.

The table shows several encoded strings and their decoded text:

Base64 input Decoded text
SGVsbG8= Hello
Q2Fmw6k= Café
8J+Yhw== a grinning emoji

If a decoded value looks like scrambled characters rather than words, the original bytes were probably not text at all. Base64 often carries images, compressed data, or binary files, and those bytes have no meaningful text representation. In that case the string was meant to be saved as a file rather than read. The tool Base64 to File takes a Base64 string and reconstructs the original file from it. The decoder itself never assumes a format, so the same encoded value can hold a sentence, a photo, or a zip archive depending on what was originally fed into the encoder. If the text looks right but a few characters seem wrong, the source may have used an encoding other than UTF-8.

Handling Whitespace and Line Breaks

Real-world Base64 rarely arrives as one clean line. Email standards wrap encoded data at fixed widths, and copying from a terminal or document often introduces spaces, tabs, or newlines. These characters are not part of the Base64 alphabet, so a strict decoder would reject them.

This tool ignores whitespace automatically. Whether your input spans one line or twenty, the decoder strips the formatting and processes only the meaningful characters. That means you can paste a wrapped block straight from an email source or a configuration file without cleaning it first.

What the decoder cannot fix is missing or corrupted data. If characters were lost during a copy, or the string was truncated, the byte count will no longer line up and decoding fails or produces garbage. When that happens, recopy the full value from its source. For URL-encoded values mixed in, URL Encode and its decoder counterpart handle that separate layer.

Why Decoding Sometimes Fails

A failed decode almost always points to an input problem rather than a tool problem. The most common cause is an invalid character. Standard Base64 uses only A-Z, a-z, 0-9, +, and /, so a string containing - or _ is likely URL-safe Base64, a variant that swaps those two symbols.

The second common cause is broken padding. A correct Base64 string has a length divisible by 4 once whitespace is removed. If padding was stripped or the value was cut short, the math no longer works.

Quick checks before you retry:

  • Confirm the string only uses the standard alphabet
  • Count characters; the total should be a multiple of 4
  • Re-copy from the original source to rule out truncation

If the value is part of a JSON Web Token, each segment is URL-safe Base64 without padding, so use JWT Decoder to read it correctly rather than decoding it raw.

Decoding Without Exposing Your Data

Base64 is not encryption, which has a direct privacy consequence: any encoded string you receive can be read by anyone, instantly. That is fine for transport, but it means encoded tokens, credentials, or personal data are effectively in the clear once decoded.

Because this tool runs entirely in your browser, the strings you paste are never sent to a server. The decoding happens on your own machine, so sensitive values such as session tokens or configuration secrets stay local. This matters when you are inspecting something that should not travel across the network.

When you do decode a secret to inspect it, treat the result with the same care as any sensitive value: clear it from your clipboard and avoid pasting it into untrusted pages. To re-encode a value after editing it, Base64 Encode produces a fresh Base64 string from your updated text. Keeping the whole encode and decode loop on one machine means you can inspect and adjust sensitive values without ever exposing them to a network.

The ones we answer the most.

Why does my decoded output look like random characters?

The Base64 probably encoded binary data, not text, such as an image or a compressed file. Those bytes have no readable text form, so they appear scrambled when shown as characters. If you expected a file rather than words, reconstruct it with Base64 to File instead of reading the output directly.

My string has dashes and underscores. Why won't it decode?

Standard Base64 uses + and /, but the URL-safe variant replaces them with - and _. A string containing those characters is URL-safe Base64. Convert the symbols back, or if the value is a token, use a tool built for that format such as JWT Decoder.

Can I paste a string with line breaks in it?

Yes. The decoder ignores spaces, tabs, and newlines automatically, so wrapped blocks copied from email sources or config files decode without cleanup. Only the valid Base64 characters are processed, and the formatting is discarded.

Is decoded Base64 the same as decrypting it?

No. Base64 is plain encoding, so decoding it requires no key and reveals the exact original data to anyone. It offers no protection. If a value looks secure only because it is Base64, it is not. Real secrets need actual encryption layered on top.

Why do I sometimes get a decoding error?

The usual reasons are an invalid character outside the standard alphabet or a length that is not a multiple of 4 after whitespace is removed. Both often come from a truncated or mistyped copy. Re-copy the full string from its source and try again.

How do I create a Base64 string in the first place?

Use Base64 Encode to encode text into Base64. Paste your content, and it returns an encoded string you can then decode here or send elsewhere. The two tools are exact inverses for UTF-8 text.