PXLTools

Base64 Encoder

Encode & decode Base64 strings and files

— or —
Drop any file to encode
Up to 10 MB

How to use Base64 Encoder

  1. Choose Encode or Decode mode.
  2. For encoding: paste text or drop a file. The Base64 result appears automatically.
  3. Enable 'Output as data URI' to get a data: URL suitable for embedding in HTML or CSS.
  4. For decoding: paste Base64 (with or without data URI prefix). Text is shown directly; binary data is offered as a download.
  5. Copy or download the result as needed.

What is Base64?

Base64 is an encoding scheme that converts binary data into a string of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). Each group of three bytes (24 bits) becomes four Base64 characters (6 bits each).

Base64 exists because many communication protocols and storage formats were designed for text, not arbitrary binary data. Email (MIME), JSON payloads, URLs, and HTML data URIs all use Base64 for this reason.

The trade-off is size: Base64 output is about 33% larger than the original. For small assets this is fine, but for larger files the overhead makes direct binary transfer (or linked resources) the better choice.

Frequently Asked Questions

What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data as a string of 64 different ASCII characters. It is commonly used when binary data needs to be stored or transferred over systems designed for text — for example, embedding images in CSS, HTML, or JSON via data URIs.
When should I use a data URI?
Data URIs (which prefix Base64 content with "data:[mime-type];base64,") are useful for embedding small images, fonts, or other binary assets directly in HTML/CSS to avoid extra HTTP requests. They are not a good choice for large files, as Base64 adds about 33% overhead to the file size.
Why is my Base64 string not decoding correctly?
Common causes: invalid characters (valid Base64 only contains A-Z, a-z, 0-9, +, /, and = padding), missing or incorrect padding, URL-safe Base64 (which uses - and _ instead of + and /), or the source data is not actually Base64. The decoded result will be a file if it is binary.
Is it safe to encode sensitive data with Base64?
No. Base64 is encoding, not encryption — anyone can decode it back to the original. Do not use Base64 as a security mechanism for passwords, tokens, or sensitive data. If you need to protect data, use proper encryption like AES.