← All tools

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 back to text — Unicode-safe, with an automatic image preview when the data is a picture. Everything runs in your browser.

About this tool

Converts text to Base64 and back using the browser's native TextEncoder/TextDecoder, so emoji and every other Unicode character round-trip correctly (plain btoa alone breaks on non-Latin text). If the Base64 you decode turns out to be a PNG, JPEG, GIF, or WebP — or you paste a data:image URI — an image preview is rendered instead of garbled bytes.

Your data never leaves the page — there is no server, no upload, and no tracking of tool inputs.

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding — a reversible way of representing bytes as 64 printable characters, with no key and no secrecy. Anyone can decode it instantly, so it must never be used to protect passwords, API keys, or personal data. If you need confidentiality, use real encryption such as AES-GCM; Base64 is only for transporting binary data through text-only channels.

How much larger does Base64 make data?

Every 3 input bytes become 4 output characters, so encoded data is about 33% larger, plus up to two = padding characters at the end. That overhead is why inlining large images as data URIs can hurt page weight — Base64-encoded assets also can't be cached or compressed as efficiently as separate binary files.

Why does btoa() fail with 'characters outside of the Latin1 range'?

JavaScript's btoa() only accepts strings whose code units fit in one byte, so emoji and most non-Latin text throw an InvalidCharacterError. The fix is to UTF-8 encode the string first (TextEncoder) and Base64 the resulting bytes — which is exactly what this tool does, so Unicode round-trips correctly in both directions.

What is the difference between Base64 and Base64URL?

Standard Base64 uses + and /, which clash with URL syntax. Base64URL swaps them for - and _ and usually drops the = padding, making the output safe in URLs, filenames, and cookies. JWTs use Base64URL — which is why pasting a JWT segment into a strict standard-Base64 decoder can fail until you translate those two characters.

How do I convert an image to Base64?

Use the Image to Base64 converter on this site — it turns a file into a data URI plus ready-made CSS and HTML snippets. This page handles the reverse direction too: paste Base64 or a data:image URI and, if it decodes to a PNG, JPEG, GIF, or WebP, you get a live image preview instead of garbled bytes.

Found this useful? 113 free, browser-only tools by Yuvrajsinh Jadav — an engineer who ships production AI systems. No account, nothing sent anywhere.