How to Decode Base64 Online (Step-by-Step Guide)
What Is Base64 Decoding?
Base64 is an encoding, not encryption. It takes raw bytes and represents them as a string of 64 ASCII characters (A-Z, a-z, 0-9, +, /) so the data can travel through channels that only understand text. Decoding does the reverse: it turns a Base64 string back into the original bytes — an image, a file, a JSON payload, or plain text.
Because Base64 is not encryption, anyone can decode a Base64 string without a key. If you want to protect data, encrypt it first and then Base64-encode the result for transport; decoding alone provides no confidentiality. That is why Base64 is used for transport and embedding, never for security.
Decoding shows up everywhere in day-to-day development: reading the payload of a JWT, inspecting an image embedded in a data URL, converting a Base64 string that an API returned into the file a user asked for, or checking whether an encoded config value is what you expected it to be. In every one of those cases the goal is the same — get back the original bytes.
You can decode base64 with our tool in a single step: paste the string, click Decode, and read the original bytes as text or download the reconstructed file. Try it on the example below:
SGVsbG8gQmFzZTY0IQ== → Hello Base64!
How to Decode Base64 Text
Start by pasting your Base64 string into the decoder box. The tool ignores whitespace and line breaks, so a copied multi-line value works fine. Click Decode and the original text appears instantly.
SGVsbG8gd29ybGQh → Hello world!
Notice the trailing = characters. Base64 uses = as padding so the output length is a multiple of four characters, which tells the decoder how many bytes the final group represents. TQ== decodes to a single byte, TWE= to two, and TWFu needs no padding at all. Padding is a strong signal that a string is Base64 and was padded by a standard encoder.
| Input bytes | Base64 output | Padding |
|---|---|---|
| 1 | TQ== | == |
| 2 | TWE= | = |
| 3 | TWFu | none |
How to Decode Base64 Files
A file is just a sequence of bytes, so decoding a Base64 file is the same process, only the result is written back to disk instead of shown as text. This is common for images, PDFs, and email attachments that were encoded for transport or an API payload.
In our decoder, paste the Base64 string and choose the file output mode. The browser reconstructs the original bytes and lets you save the file directly.
iVBORw0KGgoAAAANSUhEUgAA... → image.png (reconstructed)
The whole operation happens in your browser, so a sensitive file never leaves your machine — no upload step, no server round-trip, no stored copy.
Choose the output mode based on what the bytes represent. If the decoded content is textual — a JSON response, an XML string, a token — decode to text so you can read it. If the bytes are a binary asset such as an image, a PDF, or a ZIP archive, decode to file and save it; rendering raw bytes as text would only produce garbage.
Common Errors & Fixes
The most frequent decode failures come from a few predictable causes:
- Invalid characters — Base64 uses only
A-Z,a-z,0-9,+, and/. Characters like!,@, or stray spaces in the middle of the string (beyond line breaks) can break decoding. Strip them out and retry. - Missing padding — a string whose length is not a multiple of four is often missing
=at the end. Add the right number of=characters to fix it. - Wrong length — the total length must be a multiple of four. If it is not, padding was dropped or the value was truncated during copying.
- URL-safe Base64 — a string containing
-and_instead of+and/is URL-safe Base64 (Base64url), used in JWTs and query parameters. A decoder expecting standard Base64 may reject it; convert the characters first.
If decoding still fails, re-encode the original with a known-good encoder and compare the output. The mismatch usually points to a different encoding variant or a copy error.
FAQ
Q: Is Base64 decode the same as decrypt?
No, Base64 is an encoding, not encryption; decoding returns the original bytes without any key.
Q: How do I decode Base64 to text?
Paste the Base64 string into a decoder and click Decode to get the original text back.
Q: Why is my Base64 decode failing?
Invalid characters or missing padding cause errors; ensure valid characters and that the length is a multiple of 4.