Skip to main content

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used to embed images, fonts, or other binary files inside text-based formats such as HTML, CSS, JSON, and XML, where raw bytes cannot be stored directly.

Base64 works by grouping input bytes into 24-bit chunks and splitting each chunk into four 6-bit indices, which map to characters in the Base64 alphabet. This expands data size by about 33%, so it is a trade-off: portability at the cost of size.

The most common use cases are data URIs in CSS (embedding small images directly), embedding images in JSON APIs, and transmitting binary data in email (MIME). Base64 is encoding, not encryption — it provides no confidentiality.

When working with images, developers often convert an image to a Base64 string for inlining, or decode a Base64 string back into an image file.

Related tool

Try our free online Image to Base64 — runs in your browser, no upload needed.

Open Image to Base64

Related terms

Frequently asked questions

Is Base64 encryption?

No. Base64 is encoding, not encryption. Anyone can decode it. Never use Base64 to protect sensitive data; use proper encryption instead.

Why does Base64 increase file size?

Base64 represents every 3 bytes as 4 characters, so the encoded output is about 33% larger than the original binary data.

How do I convert an image to Base64?

Use an image-to-Base64 converter. It reads the image bytes and outputs a data URI string that you can paste directly into HTML or CSS.