Base64 Encoder

Convert text or a whole file into Base64, the plain-ASCII format used in data URIs, email attachments, JSON payloads and tokens. Text is encoded as UTF-8 so accents and emoji survive, and you can choose the URL-safe alphabet, drop the padding or wrap lines at 76 characters.

Encoding & Security Runs in your browser

Encode Text or a File to Base64

Drag and drop any file here, or click to browseAny file type, up to 10 MB. When a file is selected it is encoded instead of the text above.

How to Use the Base64 Encoder

  1. Type or paste text, or choose a file (up to 10 MB). A selected file is used instead of the text.
  2. Select the standard or URL-safe alphabet, padding and optional 76-character line wrapping.
  3. For files, tick the data URI option if you need data:type;base64, in front.
  4. Press Encode, then copy or download the Base64 text.

About This Tool

Developers embedding images or small files in HTML, CSS or JSON, people debugging API payloads and email headers, and anyone who needs a file as plain text.

Input: Text or any file  ·  Output: Base64 text.

Features and Limitations

Features

  • UTF-8 safe: é becomes the same Base64 everywhere.
  • Standard and URL-safe (RFC 4648) alphabets, with or without padding.
  • MIME-style line wrapping at 76 characters.
  • File input up to 10 MB with optional data URI prefix.
  • Shows input size, output size and the roughly 33% size overhead.

Limitations

  • Base64 is an encoding, not encryption; anyone can decode it.
  • Output is about one third larger than the input, and a 10 MB file produces roughly 13.4 million characters, which can be slow to display or copy.
  • Line breaks in the wrapped output are plain line feeds rather than the CRLF pairs of strict MIME.
  • Text is always encoded as UTF-8; other character sets are not offered.
  • Processing happens on your device, so very large files depend on your browser's available memory.

Example

Hello, World! encodes to SGVsbG8sIFdvcmxkIQ==. With URL-safe alphabet and no padding, hello becomes aGVsbG8.

Frequently Asked Questions

Is Base64 a form of encryption?

No. It only changes how bytes are written. Anyone can decode it, so never use it to protect secrets.

What is URL-safe Base64?

It replaces + with - and / with _ so the text can be used in URLs and file names without escaping. JSON Web Tokens use it, usually without = padding.

Why is the output longer than the input?

Every 3 bytes become 4 characters, so the result is about 33% larger. Line wrapping adds a few more characters.

Are accented characters and emoji handled correctly?

Yes. The text is converted to UTF-8 bytes first, so the result matches what other UTF-8 tools and servers produce.

Is my file uploaded?

No. The file is read by your browser and encoded locally.

Related Tools

More like this: all Encoding & Security tools, all Developer & Web tools or the TinySandy home page.