Base64 Decode
Paste Base64 into the box and it is decoded instantly: text is shown directly (UTF-8, so accents and non-Latin scripts stay intact); images and other files are recognised, previewed and offered as a download. You can paste a data: URI, URL-safe Base64 or text with line breaks as is. To turn text or an image into Base64, switch to the encode tab above or use Base64 Encode. Everything runs in your browser – nothing is uploaded.
How to use the Base64 decoder
- Paste the Base64 string; the decoded result appears immediately –
SGVsbG8=becomes “Hello”. - If the input isn’t valid Base64 (characters that aren’t allowed, wrong length), the reason is shown under the box.
- If the result is an image, PDF, ZIP or another file, the tool shows “binary data” with the file type and a preview for images; click “Download file” to save it.
- For text, use “Copy”, or “Send to encode” to encode it again and compare.
How to tell if text is Base64
Base64 only contains A–Z, a–z, 0–9, + and / (or - and _ in the URL-safe form), may end with one or two =, and without spaces its length is usually a multiple of 4. The first characters often reveal what’s inside:
| Starts with | Usually |
|---|---|
iVBORw0KGgo | PNG image |
/9j/ | JPEG image |
R0lGOD | GIF image |
JVBERi0 | PDF document |
UEsDB | ZIP archive (also docx, xlsx) |
eyJ | JSON, e.g. a JWT header |
Why Base64 decoding fails or shows garbage
- Extra text in front, such as
data:image/png;base64,orBasic. This tool strips data URI prefixes automatically; remove other prefixes by hand. - It isn’t Base64 at all – a hex string or encrypted data decodes into meaningless bytes.
- The content isn’t text – images and archives are binary and must be saved as a file; this tool offers a download instead.
- A different character encoding – this tool reads text as UTF-8; text encoded in another charset will look garbled.
- The string was cut off while copying from a log or web page, so the length is wrong.
How to read the contents of a JWT
A JWT (JSON Web Token) is three Base64URL parts separated by .: header, payload and signature. Paste the middle part (payload) here to see its JSON, such as the user ID or the expiry time exp (a Unix timestamp – convert it with the timestamp converter). The third part is a cryptographic signature, not text. A JWT is encoded, not encrypted, so anyone can read the payload – never put secrets in it.
Base64 decoding in each programming language
| Language / tool | Base64 to text (UTF-8) |
|---|---|
| JavaScript (Node.js) | Buffer.from(b64, 'base64').toString() |
| JavaScript (Web API) | new TextDecoder().decode(Uint8Array.from(atob(b64), (c) => c.charCodeAt(0))) |
| Python | base64.b64decode(b64).decode() |
| Java | new String(Base64.getDecoder().decode(b64), StandardCharsets.UTF_8) |
| C# | Encoding.UTF8.GetString(Convert.FromBase64String(b64)) |
| PHP | base64_decode($b64) |
| Linux / macOS | base64 -d file.txt |
For URL-safe input use base64.urlsafe_b64decode() in Python, Base64.getUrlDecoder() in Java or Buffer.from(b64, 'base64url') in Node.js. Some languages need the missing = padding added back before decoding.
Frequently asked questions
What should I do if Base64 decodes to garbage?
First check whether it is text at all: images and archives are not text and must be saved as a file. If it should be text, it may use an encoding other than UTF-8, have a prefix in front, or have been cut off while copying.
How do I convert Base64 back to an image?
Paste the image’s Base64 or data URI into this tool. It detects the image format, shows a preview, and the download button saves it as a PNG, JPEG or other image file.
Can Base64 be decrypted?
Base64 is not encryption, so no password is needed – any Base64 can be decoded. But if the content was encrypted (for example with AES) before encoding, decoding only gives you the encrypted bytes, which still need the key.
What is URL-safe Base64, and can I decode it here?
URL-safe Base64 (Base64URL) replaces + with - and / with _, and usually drops the trailing =. It is common in URLs and JWT. This tool recognises it and restores the padding automatically.
Is my data uploaded?
No. Decoding happens entirely in your browser; nothing is sent to this site or any third-party server.
- Base64 Encode: convert text, images and files to Base64.
- URL decoder: turn %20-style URL encoding back into text.
- Unix timestamp converter: convert timestamps and dates.