T TextTools

Image to Base64

Encode an image as a Base64 data URI — paste it into CSS, HTML, or JSON. Optional CSS <code>url(...)</code> wrapper.

Advertisement

How to use Image to Base64

  1. Pick an image.
  2. Toggle data: prefix and CSS wrapper as needed.
  3. Copy the result.

What is Image to Base64?

Base64-encoded images embed directly in HTML or CSS, avoiding an extra HTTP request. Useful for small icons, backgrounds in CSS files, or embedding in code where external assets aren't allowed. Note: encoding adds ~33% size — use only for small images.

Advertisement

FAQ

When should I use Base64 for images?
For small images (under ~5KB) that you'd otherwise load via HTTP. For larger images, a regular image file is faster overall.

Related tools