Base64 Encoder

Encode text to Base64 as you type, or turn an image or any other file into Base64 or a data URL for HTML, CSS and JSON. Text is encoded as UTF-8, so accents and emoji come out right.

  • Free
  • No upload
  • No sign-up

Base64 encoder and decoder

UTF-8 safe for accents and emoji. Decoding ignores line breaks and missing padding.

Runs entirely in your browser. Your data, files and text are never uploaded.

What Base64 encoding does

Base64 writes binary data using only 64 safe characters (A–Z, a–z, 0–9, + and /), so it can travel through email, JSON, XML and URLs that only accept text. Every 3 bytes become 4 characters, which makes the encoded text about 33% larger than the original.

Text is first turned into UTF-8 bytes. That is why "Žltý kôň" or an emoji encode correctly here, whereas the browser's own btoa() function fails on any character outside Latin-1.

The URL-safe variant from RFC 4648 replaces + and / with - and _, so the result can be used in URLs, file names and JSON Web Tokens; padding = signs can be left out too. For files, choose a data URL such as data:image/png;base64,… to embed small images directly in HTML or CSS.

How to use the Base64 Encoder

  1. Type or paste text in the Text field; the Base64 appears next to it immediately.
  2. Switch on the URL-safe alphabet or turn off padding if your system needs it.
  3. To encode a file, choose File → Base64 and pick an image, PDF or any file up to 5 MB.
  4. Copy the result, or download the file's Base64 as a .txt file.

Frequently asked questions

Is Base64 a form of encryption?

No. Base64 only changes how bytes are written down, and anyone can decode it instantly. Never use it to hide passwords or private data.

Why is the Base64 longer than my text?

Base64 stores 3 bytes in 4 characters, so it is about a third longer. Letters with accents and emoji take 2–4 bytes each in UTF-8, which makes the result longer still.

When should I use a data URL?

For small images and icons that you want to embed directly in HTML, CSS or JSON without a separate file. For anything larger than a few kilobytes, a normal file is usually faster.

Is my text or file uploaded?

No. Encoding is done by this page in your browser; nothing you type or open is sent to a server.