Base64 Encoder

Developer Tools

Encode text or any file to Base64, with full Unicode support and one-click decoding.

Runs entirely in your browser โ€” nothing is uploaded

Features

  • Encode and decode in the same tool โ€” switch direction without losing your input.
  • Correct UTF-8 handling for emoji and non-Latin scripts.
  • Drop in a file to encode it: images, PDFs, fonts, anything.
  • Optional URL-safe alphabet, MIME line wrapping and data: URI wrapping.
  • Live byte counts and the size cost of encoding.

How to use the Base64 Encoder

  1. 1Type or paste the text you want to encode, or drop in a file.
  2. 2Switch on URL-safe mode if the value goes into a URL, or data: URI to inline it in CSS or HTML.
  3. 3Copy the Base64 output, or hit Decode to check it round-trips.

Frequently asked questions

Why does the output differ from btoa()?

Raw btoa() throws on characters above U+00FF. This tool encodes to UTF-8 bytes first, which is what servers actually expect.

What is URL-safe Base64?

It swaps "+" and "/" for "-" and "_" and drops padding, so the value survives being placed in a URL or JWT segment.

Can I encode an image to use in CSS?

Yes. Drop the image in and switch on the data: URI option โ€” the output is ready to paste into a CSS background or an img src. Bear in mind Base64 adds about a third to the file size, so it only pays off for small assets.

Can I decode here too?

Yes โ€” this page and the Base64 Decoder are the same tool, and the Encode/Decode switch at the top moves between them. The page you arrive on only decides which direction opens first.