Base64 Encoder & Decoder
Encode or decode Base64 for text and files, generate data URIs, and switch to the URL-safe alphabet.
Runs entirely in your browser — nothing is uploadedBase64 is an encoding, not encryption. Anyone can decode it instantly — never use it to protect secrets.
Plain text
Base64
File → data URI
Drop a file or click to browse
Any file up to 16 MB · produces a data: URI you can paste into CSS or an img srcAbout the Base64 Encoder & Decoder
Encode text or any file to Base64, and decode it back. Correct UTF-8 handling means emoji and non-Latin scripts round-trip properly, which the naive btoa() approach fails at with a confusing exception.
Drop in a file to get a data URI ready to paste into CSS, an HTML src attribute, or an email template. Decoding a Base64 image shows a live preview and offers it as a download, which is handy when you have pulled an embedded asset out of a JSON payload or a log.
The URL-safe variant (- and _ in place of + and /, padding optional) is one toggle away — this is the encoding used in JWTs, URL parameters and filenames, and mixing the two alphabets up is a routine source of "invalid character" errors.
Worth stating plainly: Base64 is an encoding, not encryption. It provides no confidentiality whatsoever — anyone can decode it instantly. Use it for transport, never for secrecy.
Everything runs inside your browser using standard web APIs. Your data is never uploaded, never stored on a server, and never leaves your device — you can confirm that by opening your browser devtools Network tab, or by switching off your Wi-Fi and using the tool offline.
Frequently asked questions
Is Base64 encryption?
No, and this matters. Base64 is a reversible encoding designed to represent binary data as text. It offers zero security — anyone can decode it in one step. Never use it to protect passwords or secrets.
Why does my emoji break when encoding?
The browser's built-in btoa() only accepts Latin-1 characters and throws on anything outside it. This tool encodes to UTF-8 bytes first, so emoji, Chinese, Arabic, Devanagari and every other script round-trip correctly.
When should I use URL-safe Base64?
Whenever the result goes into a URL, a filename, or a JWT. Standard Base64 uses + and / which have reserved meanings in URLs and would be corrupted or need escaping.
How much larger does Base64 make my file?
About 33% larger, since every 3 bytes become 4 characters. That overhead is why inlining large images as data URIs usually hurts page performance rather than helping it.