~1s

About Image to Base64

Convert images to Base64 encoded strings and back. Encode any image to a Base64 data URI, raw Base64, HTML img tag, or CSS background format. Decode Base64 strings back to images. Shows original size vs Base64 size with percentage increase. Perfect for embedding images in HTML, CSS, JSON, or APIs.

Frequently Asked Questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data (like images) as an ASCII string. It converts every 3 bytes of binary data into 4 characters, making it safe to embed in text-based formats like HTML, CSS, JSON, and XML.

How much does Base64 increase file size?

Base64 encoding increases file size by approximately 33%. This is because every 3 bytes of binary data become 4 Base64 characters. For example, a 100KB image becomes roughly 133KB when Base64 encoded.

When should I use Base64 for images?

Use Base64 for small images (icons, logos under 10KB) embedded directly in HTML/CSS to reduce HTTP requests, for email templates where external images may be blocked, for API payloads, or for data URIs in CSS. Avoid Base64 for large images as it increases load times and prevents caching.

Command Palette

Search tools, navigate, or run quick actions