TidyFigure

Base64 Encoder & Decoder

  • 100% free
  • No sign-up
  • Runs in your browser

Base64 turns any data into plain text using 64 safe characters (A–Z, a–z, 0–9, + and /), so it can travel through email, JSON, URLs and HTML. Type text to encode it, switch to Decode to turn Base64 back into text, or drop a file to get a data URI you can paste into HTML or CSS.

Or encode a file to Base64 Images, fonts, PDFs… creates a data URI

Everything runs in your browser. Nothing you type is sent anywhere.

How Base64 works

Computers store everything as bytes, but many systems (email, URLs, JSON, HTML attributes) only handle plain text safely. Base64 bridges the gap. It takes the data three bytes (24 bits) at a time and splits it into four 6-bit groups. Each 6-bit group is a number from 0 to 63, written as one character from the Base64 alphabet.

Text: M a n Bytes: 77 97 110 Bits: 010011 010110 000101 101110 Base64: T W F u → "TWFu"

When the input isn't a multiple of three bytes, one or two "=" signs pad the end. Because every 3 bytes become 4 characters, Base64 output is about 33% larger than the original.

Base64 is not encryption

Anyone can decode Base64 instantly; it only changes the format. Never use it to hide passwords or secrets. It's often seen in places like HTTP Basic authentication headers, where it's only safe because the connection itself is encrypted with HTTPS.

Text and UTF-8

Plain browser functions like btoa() fail on emoji and many non-English characters. This tool first converts text to UTF-8 bytes, so "Ça va? 👋" encodes and decodes correctly, matching what Python, Java, PHP and command-line tools produce.

URL-safe Base64

Standard Base64 uses "+" and "/", which have special meanings in URLs. The URL-safe variant (also called base64url) replaces them with "-" and "_" and usually drops the "=" padding. It's used in JSON Web Tokens (JWTs), URL parameters and file names. The decoder accepts both forms automatically.

Data URIs for images and files

A data URI embeds a file directly in HTML or CSS:

<img src="data:image/png;base64,iVBORw0KGgo…"> background-image: url("data:image/svg+xml;base64,PHN2Zy…");

This saves a network request for tiny images like icons, but makes the HTML or CSS bigger and stops the browser caching the image separately. As a rule, only inline files under a few kilobytes.

Frequently asked questions

How do I decode Base64 to text?

Switch to Decode and paste the Base64. The decoded text appears instantly. Data URIs and URL-safe Base64 are handled automatically.

Is Base64 encryption?

No. Base64 is an encoding that anyone can reverse. It doesn’t protect data.

Why is Base64 bigger than the original?

Every 3 bytes become 4 characters, so Base64 is about 33% larger than the original data.

How do I convert an image to Base64?

Drop the image on the file box. You get a complete data URI you can paste into an HTML img tag or CSS.

What is URL-safe Base64?

A variant that uses - and _ instead of + and /, and usually no = padding, so it can be used in URLs and file names.

Last updated October 2026 · More developer tools