Base64 Encoder and Decoder
Encode and decode Base64 — live, in your browser.
About the Base64 Encoder and Decoder
What is Base64?
Base64 is a way of writing any data — text, an image, a whole file — using only 64 safe characters (A–Z, a–z, 0–9, + and /). It's not encryption or compression; it's a transport encoding. Systems that can only handle plain text — emails, JSON, URLs, HTML attributes — use Base64 to carry binary data safely without it getting mangled along the way.
This tool encodes and decodes Base64 the moment you type, handles full Unicode (so accents and emoji survive the round trip), and can turn a file into a ready-to-paste data: URI. Everything runs in your browser, so even sensitive data never leaves your device.
How to Use This Tool
- Pick a direction. Switch between Encode and Decode at the top — the boxes swap so you can round-trip instantly.
- Type or paste. The result updates live in the second box.
- Tweak the options. Turn on URL-safe for Base64 that's safe in links, or wrap lines at 76 characters for email-style output.
- Encode a file. Use Encode a file to data URI to Base64 any image or file — perfect for embedding directly in CSS or an
<img>tag. - Copy or download the result when you're done.
Good to know
- It's reversible, not secret: anyone can decode Base64, so never use it to hide passwords or private data.
- UTF-8 safe: text is encoded as UTF-8 first, so
é,€and emoji all convert correctly. - URL-safe variant: replaces
+/with-_and drops padding, so the result is safe in URLs and filenames. - Data URIs: encoding a file produces
data:type;base64,…that you can paste straight into HTML or CSS.
Common Use Cases
- Embedding images: inline small icons in CSS or HTML with a data URI — no extra request.
- APIs & JSON: send binary payloads through text-only fields.
- Debugging: decode a Base64 token or blob to see what's inside.
- Email & config: handle attachments and credentials that arrive Base64-encoded.
Working with URLs instead? Try the URL Encoder and URL Decoder. Turning an image into Base64 for the web? See the Image to Base64 Converter.
Frequently Asked Questions
Is Base64 encryption?
No. Base64 is fully reversible and anyone can decode it, so it offers no security. It only makes binary data safe to move through text-based systems.
Does it handle emoji and accented characters?
Yes. Text is encoded as UTF-8 before Base64, so characters like café, € and 👋 encode and decode back exactly.
What is URL-safe Base64?
Standard Base64 uses + and /, which have special meaning in URLs. URL-safe Base64 swaps them for - and _ and omits the = padding, so the result can be dropped into a link or filename. This tool decodes both variants automatically.
Can I Base64-encode an image or file?
Yes. Click Encode a file to data URI and pick any file up to 25 MB. You get a data: URI you can paste directly into HTML or CSS. It's all processed locally — the file is never uploaded.
Is my data uploaded anywhere?
No. All encoding and decoding happens in your browser with JavaScript, so your text and files never leave your device.