Encode and decode Base64 in your browser
Paste text to convert it to Base64 or back, turn a file into a data: URI with ready-to-paste CSS/HTML snippets, or paste a data: URI and download it back as a file. Everything updates instantly and runs in your browser: no upload, no signup, and it works offline.
What is Base64 and when do you need it?
Base64 encodes data using 64 printable ASCII characters so it can pass safely through systems built for text — email attachments, data: URLs, JSON and JWT tokens, HTTP Basic Auth. Because every 3 bytes become 4 characters, Base64 output is about 33% larger than the input (RFC 4648). It is a transport format, not compression and not security.
Encode vs. decode, and URL-safe mode
- Encode turns plain text into Base64.
- Decode turns Base64 back into the original text.
- URL-safe swaps
+and/for-and_and removes=padding, so the value works inside URLs and filenames.
The decoder accepts both standard and URL-safe input, ignores line breaks and fixes missing padding automatically.
How do I turn a file into a data: URI — and back?
In the file mode, drop any file up to 16 MB. The tool determines the MIME type from the file extension (deliberately so: Windows reports CSV files as an Excel type, and a wrong type makes browsers silently ignore the URI), builds the data: URI and shows the size before and after. For images you get CSS and <img> snippets, for fonts a complete @font-face rule including the format() hint that Safari requires.
The reverse direction works too: paste any data: URI — Base64 or percent-encoded — and the tool shows its MIME type and decoded size and lets you download it as a file with a fitting extension.
When is embedding a bad idea?
Honest guidance instead of a silent convert-anything button: an embedded data: URI is about a third larger than the file, browsers cannot cache it separately, and every change re-ships the whole containing file. The tool warns above 4 KB, advises against embedding above 32 KB, and refuses above 16 MB — small icons and fonts are the sweet spot, photos rarely are.
Base64 is not encryption
This is worth repeating: Base64 offers zero confidentiality. Anyone can decode it in a second. Never store passwords, API keys or personal data as “protected” just because they're Base64 — use real encryption. Base64 only makes binary data text-safe.
Correct with UTF-8
Text is read as UTF-8 before encoding, so umlauts (ä, ö, ü), accents and emoji survive the round trip exactly. The whole process happens locally with your device's own resources — your text and files are never sent anywhere.