Skip to main content
toolsxulo

Base64 Encoder

Encode text or any file into Base64, with URL-safe and data URI options.

13 B → 20 B
SGVsbG8sIHdvcmxkIQ==

How it works

Base64 takes binary data and re-represents it using only 64 printable characters (A-Z, a-z, 0-9, + and /), which makes it safe to embed in places that only handle plain text - like email bodies, URLs, or JSON strings - without any special characters causing problems. It works by grouping the data into 6-bit chunks (since 2^6 = 64) instead of the usual 8-bit bytes, then mapping each chunk to one of those 64 characters. Files are encoded the same way, byte for byte - nothing is sent to a server, the conversion happens entirely in your browser.

Read the full guide

How to use it

  1. Type or paste text, or switch to the File tab to drop in any file (images included).
  2. For files, optionally add the data: URI prefix so the output can be pasted directly into CSS or HTML.
  3. Turn on the URL-safe alphabet or 76-character line wrapping if your destination needs them, then copy or download the result.

Examples

Hello, world!SGVsbG8sIHdvcmxkIQ==

Frequently asked

Is Base64 encryption?
No. Base64 is an encoding, not encryption - anyone can decode it back to the original text instantly. It provides no security or privacy, only a text-safe representation of data.
Why does the output sometimes end with = signs?
Base64 processes data in groups of 3 bytes at a time. When the input length isn't a multiple of 3, one or two = padding characters are added at the end to complete the final group. Padding is stripped automatically when you use the URL-safe alphabet.
What's the URL-safe alphabet for?
Standard Base64 uses + and /, both of which have special meaning inside a URL. The URL-safe variant swaps them for - and _ and drops the = padding, so the result can be used directly in a URL path or query string without extra escaping.
Does my file get uploaded anywhere?
No. The file is read and encoded entirely in your browser using the FileReader API - it's never sent to a server, which is also why there's no upload size limit beyond what your browser can comfortably hold in memory.