Logo

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

SpecificationDetail
Text encodingUTF-8 safe (TextEncoder / TextDecoder)
Supported file typesAny — documents, archives, fonts, audio, video, images
Supported image formatsPNG, JPG/JPEG, GIF, WebP, SVG, BMP
Maximum file sizeLimited by browser memory (~10 MB recommended)
Base64 overhead~33% size increase over binary
Processing environmentClient-side (local browser)
Output formatRFC 2397 compliant Data URI, or raw Base64

Frequently Asked Questions

Is this Base64 encoder and decoder free?

+
Yes, completely free with no daily limits, paywalls, or account registration.

Does it handle emoji and non-English text?

+
Yes. The tool encodes through UTF-8 before Base64, so emoji, accented characters, and non-Latin scripts round-trip correctly. Tools that call btoa() directly throw an error on these characters.

Is Base64 encoding the same as encryption?

+
No. Base64 is an encoding scheme, not encryption. Anyone can reverse it instantly, so never use it to protect passwords or sensitive data — use it only to make binary data safe for text-based transport.

Does Base64 make my file larger?

+
Yes, by roughly 33%, because every 3 bytes of binary become 4 ASCII characters. For images, the WebP option compresses before encoding to help offset that penalty.

Why won't my Base64 string decode?

+
The two usual causes are a missing Data URI prefix (data:image/png;base64,) when decoding to an image, or truncated data. Base64 length should be a multiple of 4, padded with = if needed.

Can I use Base64 in HTML email templates?

+
You can, and it is a common workaround since many email clients block external images. Be aware that some clients — notably Outlook — strip Data URIs, so test before relying on it.

Why does the base64 command in my terminal give a different result?

+
It wraps the output at 76 characters by default, following the MIME spec. The characters themselves are identical, only the line breaks differ. Pass -w 0 on Linux to get a single unbroken line.

My string has dashes and underscores instead of plus and slash. Will it work?

+
Not without a swap first. That is base64url, the URL-safe variant used in JWTs and query strings. Replace every dash with a plus and every underscore with a slash, then decode as normal.

Should I store Base64 in a database column?

+
Rarely, and we push back on it most times we see it. You pay the 33% overhead on every row, every backup, and every query result. Store the binary in object storage and keep a path in the database instead.

Is there a file size ceiling?

+
No hard limit, but browser memory sets a practical one. Encoding needs room for the file plus a string a third larger, so tabs get unhappy well before 100 MB. We would move anything above 10 MB to a server-side job.

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

Advertisement