Base64 Encoder & Decoder

Encode and decode Base64 instantly. Supports file-to-data-URI conversion.

Last updated: April 2026
Input
Output Ready

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that converts binary data into ASCII characters. It uses 64 characters (A-Z, a-z, 0-9, +, /) to represent data, making it safe for text-based systems like email, JSON, and URLs.

When to Use Base64

Base64 is commonly used to embed images in HTML or CSS (data URIs), transmit binary data in JSON APIs, encode email attachments (MIME), and store binary data in text-only databases. Note that Base64 increases data size by approximately 33%, so it should not be used for large files.

How This Tool Works

This encoder uses the browser's native btoa() and atob() functions with full UTF-8 support. Your data is processed entirely in your browser — nothing is sent to any server. You can also convert files to Base64 data URIs for embedding in web pages.

Frequently Asked Questions

What is Base64 encoding used for?

Base64 converts binary data into ASCII text, making it safe for text-based systems. Common uses include embedding images in HTML/CSS as data URIs, encoding email attachments (MIME), transmitting binary data in JSON APIs, and storing binary content in text-only databases like XML.

Does Base64 encrypt my data?

No. Base64 is an encoding, not encryption. It transforms data into a different format but does not protect it. Anyone can decode Base64 back to the original data. If you need to protect sensitive data, use proper encryption (AES, RSA) before Base64 encoding.

Why does Base64 increase file size?

Base64 uses 4 ASCII characters to represent every 3 bytes of binary data, resulting in approximately 33% size increase. This trade-off is acceptable for small assets like icons and thumbnails but makes Base64 impractical for large files like videos.

What is a data URI?

A data URI embeds file content directly in HTML or CSS using the format data:[mediatype];base64,[data]. For example, a small PNG image can be embedded as an img src without requiring a separate HTTP request. This tool converts files to data URIs automatically.