Loading…

Skip to content

Image to Base64

Encode an image as a Base64 data URL for HTML, CSS or JSON.

When to use it

Embedding a tiny image as a data URL saves an HTTP request, which is handy for small icons in CSS, HTML emails or JSON payloads.

Keep it small

Base64 makes data about 33% larger and can't be cached separately, so use it only for small images.

Frequently asked questions

Is my file uploaded anywhere?

No. Everything happens inside your browser on your own device, so your files never leave your computer and there is no file-size limit imposed by a server. Very large files are limited only by your device's memory.

How do I use the result?

Paste the data URL into an <img src>, or use the CSS tab's output as a background-image value.

Related tools