Base64 Encode Online

Encode text and files to Base64 format instantly. Convert any string or file content into a Base64-encoded representation for safe data transmission.

Encode Decode

All encoding happens locally in your browser. No data is sent to any server. Your text and files remain completely private.

What It Does

Base64 encoding turns any data — text, JSON, images, whole files — into a string made of just 64 plain ASCII characters (A-Z, a-z, 0-9, + and /). It exists so binary or special data can travel safely through systems that only expect text, such as email, URLs, JSON payloads and HTTP headers, without being corrupted along the way. The trade-off is size: Base64 represents every 3 bytes as 4 characters, so the encoded output is always about a third larger than the original. This tool encodes your text (as UTF-8, so emoji and non-English characters work) and shows you the result along with how much it grew and whether it is safe to drop into a URL. One thing to be clear about: Base64 is encoding, not encryption. It hides nothing — anyone can decode it — so never use it to protect secrets.

When to Use It

  • You need to embed an image, font or small file directly inside HTML, CSS or JSON as a data URI instead of linking to a separate file.
  • You are building an HTTP Basic Authentication header, which requires the username and password to be Base64-encoded.
  • You need to store binary or special-character data inside a text-only field — a config file, environment variable, JSON value or database column.
  • You are preparing a token or payload (for example the parts of a JWT) and need the data in a compact, text-safe form.

Worked Examples

Hello, World!

A 13-character string encodes to "SGVsbG8sIFdvcmxkIQ==" — 20 characters. The trailing == is padding that makes the length a multiple of four, and you can already see the ~33% size growth.

{"role":"admin","active":true}

Encoding a small JSON object produces the kind of compact, text-safe token you see inside JWT payloads and API requests. Decode it back any time with the Base64 Decode tool.

Café ☕ in Zürich

The accented é and the emoji are multi-byte in UTF-8, so this 16-character string is more bytes than it looks. The encoder handles UTF-8 correctly, which is why the Base64 output is longer than a plain-ASCII string of the same length.

Features

Real-time encoding as you type
Full Unicode (UTF-8) support for international characters and emoji
Size-overhead and URL-safety analysis of the output
File upload support for text files
Drag and drop file import
Copy encoded result with one click
Character count for input and output
Works entirely in your browser
No data sent to any server

How to Use

1. Type or paste your text in the input area. 2. The Base64-encoded result appears instantly below, with an analysis of its size and URL-safety. 3. Optionally drag and drop a file or click Import from File to upload a text file. 4. Click Copy to copy the encoded result to your clipboard. 5. Click Clear to reset the input and output fields.

Common Mistakes

  • Treating Base64 as encryption. It protects nothing — anyone can decode it instantly. Never Base64-encode a password or secret and assume it is safe.
  • Using it to save space. Base64 makes data about 33% larger, not smaller. It is the opposite of compression and should never be used to shrink data.
  • Dropping standard Base64 into a URL or filename. The + and / characters break URLs and are invalid in filenames — convert to URL-safe Base64 (- and _) first.
  • Forgetting about UTF-8. Encoding non-ASCII text without converting to UTF-8 first corrupts the data. This tool handles UTF-8 for you, but other libraries may not by default.

Frequently Asked Questions

Explore related topics

#Utilities