Base64 Encoder & Decoder
Convert text to Base64 and back, or turn any file into a Base64 data URI you can paste straight into CSS, HTML or an API call. Full Unicode support, and nothing is uploaded — it all runs in your browser.
Encode a file — drop it here or click to choose
Images, PDFs, fonts, anything · produces a Base64 data URI
How to Encode and Decode Base64
- Paste your text into the left box and press Encode to get Base64 on the right.
- Going the other way? Paste Base64 into the right box and press Decode.
- To encode a file, drop it into the file box — you get a ready-to-paste
data:URI. - Tick URL-safe if the result goes into a web address, a JWT or a filename.
What Is Base64?
Base64 is a way of writing binary data using only 64 plain text characters (A–Z, a–z, 0–9, plus + and /). It exists because many systems — email, JSON, XML, URLs, HTML attributes — were designed for text and can corrupt or choke on raw binary bytes.
Every 3 bytes of input become 4 Base64 characters, which is why encoded output is always about 33% larger than the original. The = signs at the end are padding, added so the length is always a multiple of four.
Base64 Is Not Encryption
This is the single most important thing to know: Base64 is encoding, not encryption. It is fully reversible by anyone, needs no key, and hides nothing. Never use it to protect passwords, tokens or personal data — anyone can paste it into a tool like this one and read it instantly. Use real encryption or hashing for security.
When to Use Base64
- Inline images in CSS or HTML — a data URI removes an extra network request for small icons.
- Email attachments — MIME has used Base64 for decades to move files over a text-only protocol.
- APIs and JSON — sending a file inside a JSON field where raw bytes are not allowed.
- Basic auth headers and JWTs — both carry Base64 (and Base64URL) encoded segments.
Avoid it for large files. Because of the 33% growth, a big Base64 image in your CSS can slow a page down more than simply loading the file normally.
Standard vs URL-Safe Base64
Standard Base64 uses + and /, which both have special meanings inside a URL. URL-safe Base64 swaps them for - and _ and usually drops the = padding, so the value can travel safely in a query string, path or filename. JWTs use this variant.
Frequently Asked Questions
Does this work with emoji and other languages?
Yes. Text is encoded as UTF-8 before conversion, so emoji, accents, Arabic, Chinese and every other script round-trip perfectly.
Are my files or text uploaded?
No. Encoding and decoding happen entirely in your browser, so it is safe for private keys, config files and confidential documents.
Why do I get an error when decoding?
The input is not valid Base64 — usually a stray space, a missing character, or text that was never Base64 to begin with. Padding = must also appear only at the very end.
Is there a size limit?
Only your device’s memory. Files of a few megabytes convert instantly; very large files may take a moment and produce a lot of text.
