Base64 Encoder & Decoder
Encode and decode Base64 for text, files, and images — with full Data URI output for HTML and CSS. Runs entirely in your browser, so nothing is ever uploaded.
Plain Text
Full UTF-8 support — emoji and non-Latin scripts encode correctly.
Base64 Output
Paste It In, Get It Back Out
Your API returns a wall of text and you cannot tell what it holds. Or your config file needs a certificate as one line and the newlines keep breaking it. Most converters then throw an error on the first emoji you feed them. This Base64 encode decode tool handles all of it.
Text, any file, images, and the reverse direction — four modes, one page. Nothing uploads anywhere.
We built the text mode on TextEncoder rather than raw btoa(), which is the single most common bug in free Base64 tools. More on that below.
Base64 Encoder and Decoder for Text, Files, and Images
Base64 turns binary data into plain ASCII text so it can travel safely through systems that only handle text — JSON payloads, HTML attributes, CSS files, email bodies, and API requests. This converter handles every direction in one place: encode plain text, encode any file, encode images as Data URIs, and decode Base64 back to text or a viewable image.
Everything runs client-side using the browser's own TextEncoder and FileReader APIs. Your text and files are never uploaded, stored, or logged — which makes it safe for API keys, config fragments, and proprietary documents.
One honest limit: browser memory sets the ceiling. Encoding needs room for the file plus a string a third larger, so we would move anything past roughly 10 MB to a server-side job.
Want more detail on the mechanics? Our guide to what Base64 encoding is walks through the arithmetic step by step.
What Each Mode Does
- Text: Two-way conversion between plain text and Base64, with full UTF-8 support so emoji and non-Latin scripts encode correctly (a common failure point in tools that use raw
btoa()). - File: Encode any file type — PDF, DOCX, ZIP, fonts, audio, video — and choose either a complete Data URI or the raw Base64 payload.
- Image: Encode images as Data URIs for embedding in HTML or CSS, with optional WebP conversion to shorten the output string.
- Base64 → Image: Paste a Data URI to preview and download the original image.
Working specifically with images? Our dedicated image to Base64 converter adds format-specific output for CSS background rules and HTML <img> tags.
For heavier work each direction has its own page. Use the file to Base64 encoder for documents, archives, and fonts, and the Base64 to file decoder to turn a string back into a real download.
Why btoa() Breaks on Emoji
Paste a shrug emoji into most free Base64 tools and you get an error, not a string. The reason is specific and worth knowing.
The browser's built-in btoa() only accepts characters in the Latin-1 range, roughly the first 256 code points. Anything above that — emoji, Chinese, Arabic, Cyrillic, even a curly quote pasted from Word — throws an InvalidCharacterError.
The fix is to convert the text to UTF-8 bytes first, then Base64 those bytes. That is what TextEncoder does, and it is what this tool uses.
In our experience this is the number one reason people arrive here from a broken tool. The string was never the problem — the encoder was.
Privacy: 100% Client-Side Processing
Encoding sensitive credentials, internal documents, or unreleased assets? Your data never leaves your device. There are no backend databases, no temporary storage, and no tracking. Close the tab and the data is gone — which keeps the tool compatible with strict corporate data-handling policies.
Technical Specifications
| Specification | Detail |
|---|---|
| Text encoding | UTF-8 safe (TextEncoder / TextDecoder) |
| Supported file types | Any — documents, archives, fonts, audio, video, images |
| Supported image formats | PNG, JPG/JPEG, GIF, WebP, SVG, BMP |
| Maximum file size | Limited by browser memory (~10 MB recommended) |
| Base64 overhead | ~33% size increase over binary |
| Processing environment | Client-side (local browser) |
| Output format | RFC 2397 compliant Data URI, or raw Base64 |
Frequently Asked Questions
Is this Base64 encoder and decoder free?
+
Does it handle emoji and non-English text?
+
Is Base64 encoding the same as encryption?
+
Does Base64 make my file larger?
+
Why won't my Base64 string decode?
+
Can I use Base64 in HTML email templates?
+
Why does the base64 command in my terminal give a different result?
+
My string has dashes and underscores instead of plus and slash. Will it work?
+
Should I store Base64 in a database column?
+
Is there a file size ceiling?
+
The Short Version
Pick a mode, paste or upload, copy the result. Base64 encode decode work should take seconds, and here it does — including for text your last tool refused.
Just remember what Base64 is not. It is transport, not protection. Anyone holding your string can read it back in one click.
Related Tools You Might Like
Case Converter
Convert text between UPPERCASE, lowercase, Title Case, and more
Password Generator
Generate secure, random passwords with custom options
Word Counter
Count words, characters, paragraphs, and reading time
File to Base64
Encode any file type to Base64 or a Data URI, with the MIME type filled in
Base64 to File
Decode a Base64 string into a real file, with the type read from its header bytes
Regex Tester
Test and validate regular expressions with live preview
