Encode text or files to Base64, decode Base64 back to text or files, switch to Base64URL,
add or remove padding, validate input, and download results. Everything runs locally in your browser.
Text
0 bytes
Output
0 chars
Tip: Ctrl/Cmd + K focuses the input. Ctrl/Cmd + Enter repeats last action.
Standard Base64 uses letters, numbers, +, /, and sometimes =.
If your string contains - or _, enable URL-safe mode.
Missing padding
Some systems remove trailing = characters. If decoding fails, try adding padding
until the Base64 length is a multiple of 4.
Decoded text looks broken
The Base64 may represent binary data such as an image, PDF, ZIP, or certificate rather than text.
Use the Base64-to-file option instead of reading it as UTF-8 text.
Data URL will not decode
A data URL starts with a prefix such as data:image/png;base64,. This tool accepts
data URLs, but the actual Base64 payload begins after the comma.
FAQs: Base64 Encoder & Decoder
What is Base64 used for?
Base64 is an encoding that turns arbitrary binary data into ASCII text. It’s commonly used in email (MIME),
data URLs (e.g., embedding small images), JSON/API payloads, and anywhere binary needs to travel over text-only channels.
What is URL-safe Base64?
URL-safe Base64 follows RFC 4648: it replaces + with - and / with _
so the string can appear in URLs and filenames without escaping. Some systems also drop the trailing = padding.
Does this tool upload my data?
No. All encoding/decoding happens locally in your browser. If you use file features, files are processed in-memory;
nothing is sent to a server.
Why do some Base64 strings end with =?
= characters are padding so the output length is a multiple of 4 characters. Many parsers accept
unpadded Base64, but some require padding. Turn off “Include padding =” only if your target system allows unpadded Base64.
What’s the difference between encoding and encryption?
Encoding (Base64) is reversible and not a security measure—it just re-formats data. Encryption protects data and requires keys.
Don’t use Base64 for secrecy.
Can I use this with non-Latin text or emojis?
Yes. The tool uses UTF-8 via TextEncoder/TextDecoder, so Unicode text (e.g., emojis, CJK) round-trips correctly.
How do I convert files?
Use the file picker. “File → Base64” produces the Base64 payload (suitable for data URIs or JSON).
To recover a file, paste its Base64, then click “Base64 → File” to download.
Why does my Base64 contain line breaks?
Some legacy encoders wrap lines at 76 characters (MIME). This tool doesn’t insert line breaks. If your input has them,
it will still decode successfully.
What’s the maximum size I can convert?
There’s no fixed limit, but browser memory is finite. Very large files (hundreds of MB) may be slow or fail. For huge data,
prefer streaming or server-side tooling.
How do I make a data URL from Base64?
Prepend the MIME type and the base64 flag, e.g. data:image/png;base64,AAAA….
You can get the MIME type from the selected file when using the file encoder.
Why does validation say “invalid characters”?
Strict mode rejects characters outside the Base64 alphabet. Enable “URL-safe” if your input uses - and _,
or disable strict validation to attempt a best-effort decode.
🧩 5 Fun Facts about Base64
1
Made for email
Base64 landed in the early ’90s for MIME email so binary attachments could survive 7-bit mail relays without mangling.
Origins
2
3 bytes → 4 chars
Each 24-bit chunk splits into four 6-bit values. Those map to 64 symbols; padding just fills the final quartet.
Encoding math
3
URL-safe swaps two signs
RFC 4648 replaces +// with -/_ so Base64 can live in URLs and filenames without escaping.
Transport trick
4
Not a lock
Base64 is reversible formatting, not security. Anyone can decode it with one line—use real encryption for secrecy.
Misconception
5
Data URLs bundle type
data: URLs store the MIME type plus Base64 so tiny images or fonts ride inside HTML/CSS with zero extra requests.