Base64 Encoder & Decoder — Text, Files, URL-Safe
Text
Output
Tip: Ctrl/Cmd + K focuses the input. Ctrl/Cmd + Enter repeats last action.
Files
File → Base64
Base64 → File
Understands raw Base64 or data:[mime];base64,....
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—use the “Omit padding” toggle only if your target system allows it.
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 or drag-and-drop. “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.