Encode text, decode Base64 strings, or turn files into data URLs — all in your browser. Nothing gets uploaded anywhere.

Input
Empty
Output

Paste Base64 or plain text on the left to see the result here.

Analysis
0 B
Input Size
0 B
Output Size
0
Characters
0
Lines
Mode Encode
Status Empty
Detected Type None

What you can do with this tool

No sign-up, no uploads, no nonsense. Just Base64 encoding and decoding that works.

Text to Base64

Paste any text and get the encoded output instantly.

File Upload

Drop a file to get its Base64 data URL with correct MIME type.

Image Preview

Decoding an image? You'll see a live preview right here.

Fully Offline

Everything happens in your browser. Zero server calls.

What Is Base64 and When Do You Actually Need It?

If you've ever pasted a long string of random-looking characters into a terminal, an API request, or a CSS file — chances are you were dealing with Base64. It's one of those things developers use constantly without thinking about it much, until something breaks.

Base64 is a way to represent binary data (like images, files, or anything non-text) using only plain ASCII characters. The name comes from the 64-character alphabet it uses: A-Z, a-z, 0-9, +, and /, with = for padding.

The reason it exists is simple: a lot of systems — email, JSON, URLs, HTML attributes — were built to handle text, not raw bytes. When you need to shove a PNG into a JSON payload or embed a font in a stylesheet, Base64 gives you a text-safe way to do it.

A quick example

Encoding the string Hello World gives you SGVsbG8gV29ybGQ=. That trailing = is padding — Base64 works in chunks of 3 bytes, and when the input doesn't divide evenly, it pads the output.

You can try it right now in your browser console:

btoa('Hello World')    // "SGVsbG8gV29ybGQ="
atob('SGVsbG8gV29ybGQ=')  // "Hello World"

Where you'll run into Base64

Here are some of the places Base64 shows up in everyday development work:

  • Data URLs — Embedding small images or icons directly into HTML or CSS with data:image/png;base64,... to save an extra HTTP request.
  • API payloads — Some APIs expect file uploads, signatures, or binary data sent as Base64-encoded strings inside JSON bodies.
  • Email attachments — MIME encoding has used Base64 since the early days of email. Every attachment you've ever sent was Base64 under the hood.
  • JWTs — JSON Web Tokens encode their header and payload as Base64url (a URL-safe variant). You've probably decoded a JWT to debug auth issues at some point.
  • Certificates — PEM files (the ones that start with -----BEGIN CERTIFICATE-----) are just Base64-encoded DER data.

The 33% size increase — and why it usually doesn't matter

The most common criticism of Base64 is that it makes data bigger. And it's true — encoding adds roughly 33% overhead because you're using 4 characters to represent every 3 bytes. A 30KB image becomes about 40KB in Base64.

For small assets (icons, tiny logos, placeholder images under 5KB), the tradeoff is often worth it. You eliminate an HTTP request, which can matter more than a few extra kilobytes, especially on high-latency connections. But for anything larger — a product photo, a PDF, a video — just use a normal file URL. There's no benefit to Base64-encoding a 2MB image.

Common mistakes that trip people up

After seeing developers run into the same issues repeatedly, here are the ones worth knowing about:

  • Forgetting the MIME prefix — If you're using Base64 in an <img> tag or CSS url(), you need the full data URL: data:image/png;base64,iVBOR.... Just the encoded string won't render anything.
  • Whitespace in the string — Copy-pasting Base64 from emails or formatted text often introduces line breaks. Most decoders handle this, but some strict parsers will choke on it.
  • Assuming decoded output is always text — Not every Base64 string decodes to something you can read. If the original was a JPEG or a ZIP file, you'll get binary garbage in a text editor. That's expected.
  • Using Base64 for "encryption" — This comes up more than you'd think. Base64 is encoding, not encryption. Anyone can decode it instantly. It provides zero security.

About this tool

Everything runs in your browser. Your text, files, and encoded output never hit a server — there's no backend processing involved at all. This makes it safe to use with API keys, tokens, certificates, or any other sensitive data you'd rather not paste into a random website.

You can encode plain text, upload files (images, documents, whatever) and get the Base64 output with the correct MIME type, or paste a Base64 string and decode it back. If the decoded content is an image, you'll get a preview. If it's binary, you can download it directly.

Frequently Asked Questions

Is my data safe when I use this tool?

Yes — nothing leaves your browser. The encoding and decoding happens entirely in JavaScript on your device. We don't send your input to any server, and there's no backend involved. You can verify this by opening your browser's Network tab while using the tool.

Why does Base64 make files bigger?

Base64 uses 4 text characters to represent every 3 bytes of binary data, which adds about 33% to the size. So a 30KB image becomes roughly 40KB when encoded. For small assets like icons, this overhead is negligible. For larger files, it's usually better to serve them as regular files and skip Base64 entirely.

What's the difference between encoding and decoding?

Encoding takes your original content (text, an image, a file) and converts it into a Base64 string. Decoding does the reverse — it takes a Base64 string and gives you back the original content. Think of it like translating between two languages; the information stays the same, just the representation changes.

Can I use this for images?

Absolutely. Upload any image and you'll get a Base64 data URL you can drop straight into an <img> tag or a CSS background-image. The tool detects the MIME type automatically, so the output includes the correct data:image/... prefix. If you're decoding a Base64 string that contains an image, you'll also get a visual preview.

Is Base64 a form of encryption?

No. This is a common misconception. Base64 is encoding, not encryption — anyone can decode a Base64 string instantly with no key or password. It's designed to make binary data safe for text-based systems, not to hide information. If you need to protect sensitive data, use actual encryption (AES, RSA, etc.).

Why do I get unreadable characters when I decode something?

That usually means the original content was binary (like an image, PDF, or compressed file), not text. When you decode it and try to display it as text, you get gibberish. That's normal. Try downloading the decoded output as a file instead — the tool's download button handles this for you.