About the Base64 Decoder
Paste Base64 and the Base64 Decoder turns it back into what it was: readable text, or the original file. It handles standard Base64, the URL-safe variant with - and _, text with or without = padding, Base64 broken across several lines, and complete data URLs.
The decoder looks at the result to decide how to show it. Text is shown as text, decoded as UTF-8 so every language and emoji comes out right. Binary data is recognized by its first bytes: PNG, JPEG, GIF, WebP and other images get a preview, and PDFs, ZIP archives, fonts, audio and video files get the right file extension so you can download and open them.
If the input is not valid Base64, you get a clear message that says what is wrong and where. Everything is decoded in your browser, so nothing you paste is uploaded.
How to use it
- Paste the Base64Paste it into the left box, drop a text file onto it, or use Open .txt. Sample loads a short encoded greeting.
- Read the resultText appears on the right as you paste. The status line says how many bytes were decoded.
- Check binary filesIf the data is a file, you see what type it is and how big it is. Images also show a preview.
- Name the fileFor binary data, the file name is filled in with the right extension, such as decoded.png. Change it if you like.
- Copy or downloadCopy decoded text, or click Download to save the text or the file.
Key features
Every common variant
Standard and URL-safe Base64, with or without padding. Spaces and line breaks in the input are ignored.
Data URLs
Paste a complete data:image/png;base64,... link and the prefix is handled for you.
UTF-8 text
Decoded text is read as UTF-8, so accented letters, other alphabets and emoji show correctly.
File type detection
Recognizes PNG, JPEG, GIF, WebP, AVIF, HEIC, BMP, ICO and SVG images, PDF, ZIP and GZIP files, WOFF fonts, MP3 and OGG audio, and MP4 and WebM video.
Image preview
Decoded images are shown right away, so you can see what you have before you download it.
Helpful errors
Invalid characters, misplaced padding and a wrong length are explained, with the position of the problem.
Examples
Decoding text
The Sample button loads this Base64:
SGVsbG8sIHdvcmxkISBHcsO8w59lIGF1cyBNw7xuY2hlbiDwn5GL
It decodes to Hello, world! Grüße aus München 👋, and the status line shows 39 B of UTF-8 text. Other forms are decoded just as easily:
| Base64 | Decoded |
|---|---|
SGVsbG8 (no padding) | Hello |
PDw_Pz8-Pg (URL-safe) | <<???>> |
A data URL works as well: data:text/plain;base64,SGVsbG8= also gives Hello. Base64 split over several lines, as in emails, works too: SGVsbG8s, IHdvcmxk and IQ== on three lines decode to "Hello, world!".
Reading a token payload
The middle part of a JSON Web Token is URL-safe Base64 without padding. Paste just that part, for example:
eyJzdWIiOiI0MiIsIm5hbWUiOiJBbmEiLCJhZG1pbiI6dHJ1ZX0
and you get the JSON inside: {"sub":"42","name":"Ana","admin":true}. Paste only the part between the two dots; the dots themselves are not Base64.
Decoding an image
Paste this Base64, with or without the data:image/png;base64, prefix:
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
The status line says Decoded PNG image, 70 B, a preview of the 1×1 pixel image appears, and the file name is set to decoded.png. Base64 that starts with iVBOR is almost always a PNG, and JVBER is a PDF.
Error messages
| Input | Message |
|---|---|
SGVsbG8* | "*" is not a Base64 character (position 8) |
SGVs=bG8 | Padding "=" can only appear at the end |
SGVsb | The text is one character too long or too short to be valid Base64 |
Tips
- If the decoded text looks like a jumble of symbols, the data is probably a file, not text, or it was encoded twice. Try decoding the result once more.
- When you copy Base64 from an email or a log file, stray spaces and line breaks do not matter; they are removed before decoding.
- For JSON Web Tokens, decode the header and the payload separately. The third part is a signature and decodes to unreadable bytes.
- Check the file type before you open a downloaded file. If the decoder says "binary data" without a type, the content may be compressed or encrypted rather than a normal file.
- To turn a file back into Base64 after editing it, use the Base64 Encoder.
Common mistakes and limits
- Pasting a whole token or URLDots, question marks and other characters are not part of Base64, so the decoder stops at them. Paste only the encoded part.
- Expecting text in an older encodingText that was encoded as Latin-1 or Windows-1252, such as "café" stored in an old database, is not valid UTF-8. The decoder then treats it as binary data; download it and open it in a text editor that lets you pick the encoding.
- Missing or extra charactersBase64 loses its meaning if a character is cut off when copying. "The text is one character too long or too short" usually means part of the string is missing.
- Assuming decoded data is safeDecoding only reverses the encoding. A decoded file can still contain anything, so only open files from sources you trust.
- Thinking Base64 was protecting somethingIf you can decode it, so can anyone. Base64 is not encryption, so passwords or keys stored as Base64 are not protected.