Base64 Decode and Encode
Turn Base64 back into text, images and files, or encode text as Base64.
Runs in your browser. Nothing you enter is uploaded.
How to use Base64 Decode and Encode
- Paste the Base64. Spaces, line breaks and a data:image/png;base64, prefix are fine.
- Read the result: text appears right away. Images and other files get a preview and a Download button below the tool.
- Check the notes under the result: they say what was fixed, like missing = padding.
- To go the other way, choose Encode and type your text. Turn on URL-safe for links and file names.
- Copy the result, or download it as a .txt file. Nothing you paste leaves your device.
Examples
Base64 to text
- Mode: Decode
SGVsbG8sIHdvcmxkIQ==
Hello, world!
Each group of 4 characters becomes 3 bytes, read as UTF-8 text.
A JWT payload
- Mode: Decode
eyJzdWIiOiIxMjM0NSIsIm5hbWUiOiJBbm5hIiwiYWRtaW4iOnRydWV9
{"sub":"12345","name":"Anna","admin":true} JWTs use URL-safe Base64 without = padding. The padding is added for you, and the JSON inside appears.
Text to Base64
- Mode: Encode
- URL-safe (- and _, no =): Off
- Line break every 76 characters: Off
Hello, world!
SGVsbG8sIHdvcmxkIQ==
13 bytes become 20 characters. The == fills the last group of 4.
Accents and emoji
- Mode: Encode
- URL-safe (- and _, no =): Off
- Line break every 76 characters: Off
Café ☕
Q2Fmw6kg4piV
The text is turned into UTF-8 bytes first: é takes 2 bytes and ☕ takes 3.
How it works
Base64 writes any data, text or files, with 64 safe characters: A–Z, a–z, 0–9, + and /. Every 3 bytes become 4 characters, so Base64 is about a third larger than the data it holds. Decoding reverses that. Everything runs in your browser: nothing you paste is uploaded, which matters when the Base64 holds a token or a private file.
What the decoder fixes for you
Base64 copied from emails, logs, code and web pages is rarely clean. The decoder:
- skips spaces and line breaks, like the line every 76 characters in email attachments,
- reads URL-safe Base64, which uses - and _ instead of + and /,
- adds missing = padding at the end, which JWTs and many APIs leave out,
- removes a data: URL prefix, like
data:image/png;base64,.
The notes under the result list what it fixed. When something can’t be fixed, like a character that isn’t Base64 or text after the = padding, the tool shows the exact line and column.
Text, images and files
If the decoded bytes are UTF-8 text, you see the text. Text in an older encoding is read as Windows-1252 (Latin-1), with a note.
If they are a file, the tool recognizes common types by their first bytes: PNG, JPEG, GIF, WebP, SVG and ICO images, PDF, ZIP (including Word, Excel and PowerPoint files), gzip, MP3, MP4, WOFF and WOFF2 fonts. Images get a preview with their size in pixels, and every file gets a Download button. The result box shows the first 1,024 bytes in hex, which is how developers usually inspect binary data.
Encoding
Choose Encode to turn text into Base64. The text is turned into UTF-8 bytes first, so accented letters and emoji come back exactly as typed when the Base64 is decoded.
- URL-safe (- and _, no =) makes Base64 you can put in a web address or a file name without escaping.
- Line break every 76 characters matches the format email (MIME) uses for attachments.
Base64 isn’t encryption
Anyone can decode Base64, so it hides nothing. A JWT’s payload, for example, is readable by anyone who has the token: decoding it here shows what it contains, but doesn’t check that its signature is valid.
Questions
How do I decode Base64?
Paste it above with Decode selected. Text appears in the result right away. If the Base64 holds an image or another file, you get a preview and a Download button instead.
Is Base64 encryption?
No. Base64 only changes how data is written so it can travel as plain text, and anyone can decode it. Never use it to hide passwords or personal data.
Why does Base64 end with = or ==?
Base64 turns every 3 bytes into 4 characters. When the data doesn’t divide into groups of 3, the last group is filled up with = (one byte short) or == (two bytes short). Some systems leave the padding out; this tool adds it back.
What is URL-safe Base64?
A version that uses - and _ instead of + and /, because + and / have special meanings in web addresses. It usually drops the = padding too. JWTs use it. The decoder reads both kinds.
How do I convert Base64 to an image?
Paste the Base64, with or without the data:image/png;base64, prefix, and keep Decode selected. A preview of the image and a Download button appear under the tool. PNG, JPEG, GIF, WebP, SVG and ICO images are recognized.
How do I decode Base64 on the command line?
On Linux and macOS: echo 'SGVsbG8=' | base64 --decode. In Windows PowerShell: [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('SGVsbG8=')).
Related tools
- JSON Formatter Format, validate and repair JSON, with the exact line of every error.
- URL Decode and Encode Decode %-encoded links and list their parameters, or encode text.
- Binary Translator Translate binary to text and text to binary, emoji included.
- Invisible Character Remover Find and remove zero-width spaces and other hidden characters.
- HTML to Text Strip HTML tags and keep paragraphs, lists and links.
Updated October 19, 2026 · Works in current Chrome, Edge, Firefox and Safari · Runs entirely in your browser