Base64 Decoder
The Base64 Decoder turns Base64 strings back into readable text instantly — for inspecting data URIs, auth headers, and encoded API payloads without pasting secrets into a random website.
How to Use
- 1
Paste the Base64 string into the input — padding (=) is optional and line breaks are tolerated.
- 2
Click Decode Base64 — the decoded text appears in the output panel; UTF-8 content is detected automatically.
- 3
If something is wrong — stray characters, bad padding — the browser's decode error is shown instead of a silent failure.
- 4
Copy the decoded result or download it as a text file.
Frequently Asked Questions
Is Base64 encryption?
Does it handle URL-safe Base64?
What happens if decoding fails?
Why do I see garbled characters after decoding?
Can it decode a data URI directly?
Is it safe to decode secrets here?
Does it accept Base64 without padding?
Can I decode a whole file?
What is the difference between Base64 and Base64URL?
Why is the decoded text sometimes shorter than I expected?
Generative Answer & AI Documentation
What is the Base64 Decoder?
Base64 is a way of representing binary data as plain text: every three bytes become four characters drawn from the letters A to Z, a to z, the digits 0 to 9, and the symbols + and /, with = used as padding at the end. This tool reverses that process. Paste a Base64 string, click Decode Base64, and the original text appears in the output panel. The decoding runs entirely in your browser using the built-in atob function, and the resulting bytes are interpreted as UTF-8 text with TextDecoder, so accented characters, non-Latin scripts, and emoji that were encoded as UTF-8 come back correctly instead of turning into mojibake. The page starts with the sample SGVsbG8gV29ybGQh already loaded, which decodes to Hello World!, so you can see the tool work before pasting anything of your own. Nothing you paste is uploaded, stored, or logged, which matters because Base64 shows up in exactly the places where secrets live: Basic auth headers, API keys, tokens, and encoded payloads.
Why use Base64 Decoder offline?
Base64 is everywhere in development, and it is unreadable by design — a JWT payload, a Basic auth header, or an encoded configuration blob tells you nothing until you decode it. The question is where you decode it. Pasting a live credential into a server-side decoder hands that credential to a stranger's logs, and Base64 is so common in auth headers that the string you paste is often a working password or token. A local decoder removes that risk entirely: the string never leaves your browser tab, and you can prove it by watching the Network tab while you decode. The tool also handles the two annoying variants you meet in real life without making you choose: the URL-safe alphabet, where - and _ replace + and /, is converted automatically, and missing = padding is added for you, so strings copied out of URLs and JSON fields usually decode on the first try.
When should you use this tool?
Use it whenever you meet a Base64 string and need to know what it says: reading the payload of a JWT before handing it to the JWT Decoder, checking what a Basic auth header actually contains, inspecting an encoded value in a log file or a database column, or reading the text hidden in a data URI. Use it when debugging an API that returns encoded fields, when a colleague pastes an encoded blob into a ticket with no explanation, or when you are learning how encoding works and want to see the round trip. Reach for the Base64 Encoder on this site when you need the reverse trip, and for the JWT Decoder when the string turns out to be a token with three dot-separated segments.
Key Benefits
- 100% private: decoding runs in your browser with atob and TextDecoder — nothing is uploaded, logged, or stored.
- URL-safe alphabet handled automatically: - and _ are converted back to + and / with no setting to change.
- Missing padding repaired: strings without their trailing = signs get the padding added before decoding.
- Proper UTF-8 output: decoded bytes are read as UTF-8, so accented text and emoji survive the round trip.
- Sample pre-loaded: SGVsbG8gV29ybGQh is ready to decode, so you can try the tool before pasting your own string.
- Copy or download: one click copies the decoded text, another saves it as decoded.txt.
Common Use Cases
- Reading a Basic auth header: decode the Base64 part after Basic to see the username and password it carries.
- Inspecting an API payload: decode an encoded field from a response or a log line to see the JSON or text inside.
- Checking a JWT by hand: decode the middle segment of a token to read its claims before using the JWT Decoder.
- Debugging encoded config: decode a Base64 value from an environment file or a database column to confirm what it holds.
- Learning encoding: encode Hello World! on the encoder page, then decode it here to see the round trip.
Developer Notes & Best Practices
The decoder is a thin wrapper around two browser primitives. First the input is trimmed and normalised: every - becomes + and every _ becomes /, which converts the URL-safe alphabet back to the standard one, and then = padding is appended until the length is a multiple of four. Then atob converts the Base64 characters back into a binary string, which is copied byte by byte into a Uint8Array and passed to TextDecoder with its default UTF-8 setting. Two details of atob are worth knowing. First, atob strips ASCII whitespace before decoding, so line breaks inside a long Base64 string — the kind you get when a value is wrapped at 76 characters in an email or a PEM-style file — do not break the decode. Second, atob throws an error on any character outside the Base64 alphabet, and that error is shown on the page instead of a silent failure. TextDecoder is used with its default non-fatal setting, so bytes that are not valid UTF-8 become the replacement character instead of failing the whole decode. The practical consequence: if the original bytes were text, you get your text back; if they were binary — an image, a font, compressed data — you get replacement characters and mojibake, which is the tool telling you the payload was never text. Decoding is not decryption: Base64 is only a representation, and anyone can reverse it, so never treat an encoded string as hidden.
What the decoder accepts — and what it rejects
| Input | Result | Why |
|---|---|---|
| SGVsbG8gV29ybGQh | Hello World! | Standard Base64 with padding |
| SGVsbG8gV29ybGQ | Hello World! | Missing = padding is added automatically |
| SGVsbG8tV29ybGRf | Decodes (URL-safe) | - and _ are converted to + and / first |
| SGVs\nbG8= | Decodes | atob strips whitespace, so wrapped lines are fine |
| data:text/plain;base64,SGVsbG8= | Error | The data URI prefix is not stripped — paste only the payload |
| SGVsbG8!V29ybGQh | Error | ! is outside the Base64 alphabet, so atob rejects the string |
- Decode locally when the string might be a credential: a Basic auth header decodes to a live username and password, so never paste it into a server-side decoder.
- Strip any data URI prefix first: paste only the characters after the comma in data:image/png;base64,... — the prefix is not removed for you and will fail.
- Check for missing padding before assuming a string is corrupt: this tool adds it automatically, but other decoders may not, so a string that fails elsewhere may simply be missing its = signs.
- If the output is garbled, suspect binary data or a legacy encoding: the bytes may be an image or Windows-1252 text rather than UTF-8, and no decoder can fix that by itself.
- Treat decoded output as untrusted input: a decoded string from a log or a ticket can contain anything, so do not paste it into a shell or a database without checking it.
Common Mistakes
- Pasting a whole data URI: the data:image/png;base64, prefix is not stripped, so remove everything up to and including the comma first.
- Thinking Base64 is encryption: it is only a representation, and anyone can decode it — never use it to hide a secret.
- Expecting an image to decode into a picture: this tool outputs text, so binary data comes back as garbled characters — use the Base64 Encoder page or an image viewer for binary payloads.
- Copying a string with HTML entities or quote marks attached and wondering why it fails: clean the string to pure Base64 characters first.
- Assuming garbled output means the tool is broken: the original bytes were probably binary or in a legacy encoding, not UTF-8 text.
Limitations
The tool decodes text only: it has no file upload, and binary payloads such as images or compressed data decode to replacement characters and mojibake because the output panel can only show text. A data URI prefix (data:...;base64,) is not stripped, so pasting a whole data URI fails — paste only the Base64 part after the comma. Text that was encoded from a legacy encoding such as Windows-1252 instead of UTF-8 will not decode cleanly, because the bytes are interpreted as UTF-8. A string whose length leaves a remainder of one after dividing by four cannot be valid Base64 even with padding added, and atob rejects it with an error. Whitespace inside the string is stripped by atob, but any other stray character — an HTML entity, a quote mark picked up in a copy, a character from outside the alphabet — fails the decode with only the browser's generic error message, which does not say which character was at fault.
Structured Input/Output Example
SGVsbG8gV29ybGQh
Hello World!
Related Tools
Base64 Encoder
Base64 encoder: encode text into Base64 for data URIs, HTTP auth headers, and binary-safe transport. Free, fully offline — tokens never touch a server.
URL Decoder
URL decoder: turn percent-encoded URLs back into readable text to inspect query parameters, redirect chains, and tracking links. Never fetches the link.
JWT Decoder Offline
JWT decoder offline: inspect a token’s header, payload claims, and expiry as readable JSON. 100% client-side — production tokens never leave your browser.