Base64 Decoder
Decode Base64, URL-safe Base64 and data URIs back to readable text — or preview and download images and files hidden inside. Tolerant of line breaks and missing padding.
data:image/png;base64,… to preview the image.Need to encode instead? Base64 Encoder →How Base64 Decoding Works
Turning 4 text characters back into the 3 original bytes.
Base64 decoding reverses the encoding process: every group of four characters maps back to three bytes of the original data. The result can be plain text (JSON, XML, a config file, a message) or binary data such as an image, PDF or font.
This decoder reads the bytes as UTF-8 by default, so non-English text and emoji come out correctly. If the text looks garbled (é instead of é), switch to Latin-1 for older Windows/ISO-8859-1 data.
When the decoded bytes aren't readable text, the tool recognises the file type from its signature (“magic bytes”) — PNG, JPEG, GIF, WebP, PDF, ZIP, fonts and more — shows an image preview, and lets you download the file.
Input is handled tolerantly: line breaks, spaces, missing = padding, the URL-safe alphabet and data: prefixes are all accepted. Genuinely invalid characters are reported with their exact position.
What the Decoder Accepts
Common Base64 problems and how they're handled.
| Input | Example | Result |
|---|---|---|
| Standard Base64 | SGVsbG8= | Decoded normally |
| URL-safe (JWT style) | PDw_Pz4- | - and _ are converted automatically |
| Missing padding | SGVsbG8 | Padding is added for you |
| Line breaks / spaces (MIME, PEM) | SGVs | Whitespace is ignored |
| Data URI | data:image/png;base64,iVBOR… | Prefix stripped, image previewed |
| Invalid character | SGV$bG8= | Error with the exact position |
| Truncated data | SGVsb | Error: length is invalid |
How to Use the Base64 Decoder
Get your result in under ten seconds.
Paste Base64
Paste a Base64 string, URL-safe token segment or full data URI into the input box.
Read the result
Text appears instantly. Binary data is detected automatically, with a preview for images.
Copy or download
Copy the decoded text, or download it — binary files keep their detected extension.
Why Use the Base64 Decoder on Developers Web Tools
Fast, accurate and private — built for developers.
Nothing uploaded
Decoding happens locally, so tokens, keys and private files never leave your device.
Image preview
Decoded PNG, JPEG, GIF, WebP and other images are shown right away.
Precise errors
Invalid characters are reported with their position instead of a vague “failed to decode”.
Tolerant input
Handles URL-safe Base64, missing padding, MIME line breaks and data URIs.
UTF-8 & Latin-1
Decode modern UTF-8 text with emoji, or switch to Latin-1 for legacy data.
Built for big data
Chunked decoding and preview truncation keep megabytes of input smooth.
Frequently Asked Questions
The bytes were probably not UTF-8 text. Try the Latin-1 charset for legacy data. If the panel says binary data was detected, the Base64 contains a file (like an image or PDF) rather than text — use Download file.
Base64 only contains A–Z, a–z, 0–9, +, / (or - and _ for URL-safe) and = padding. Anything else — often a stray quote, a % from URL-encoding, or a copied ellipsis — makes the data invalid. The position counts characters after whitespace is removed.
Yes. The - and _ characters are converted automatically and missing padding is added. For full tokens, the dedicated JWT Decoder shows the header, payload and expiry in a readable table.
Paste the string (with or without the data:image/…;base64, prefix). If it's an image, a preview appears and Download file saves it with the right extension.
Yes. Everything runs in your browser with JavaScript — nothing is sent to a server, logged or stored.
Valid Base64 can never have a length that leaves exactly one character in the last group of four. This usually means the string was cut off when copying — check you copied all of it.