Image to Base64.
Copy the string.
Turn a small image into a data URI you can paste into HTML, CSS, or a JSON fixture. Everything happens locally.
How do I convert an image to Base64? Upload a small image and copy the data URI for use in HTML or CSS.
Image to Base64 converter
Your encoded image
Base64 makes files larger than their binary form, so it is usually best for small images rather than photographs.
How to convert an image to Base64
- Add a small image — a logo or icon.
- Copy the data URI — the full
data:image/png;base64,…string. - Paste it into CSS or HTML — no extra request, no external file.
Where Base64 images make sense
- Tiny icons embedded in a CSS file
- Single-file HTML demos and prototypes
- Contexts that cannot reference external files at all
Good to know
Base64 inflates an image by about a third and blocks parallel downloads — it is a tool for small assets under ~10 KB, not for photos. For anything bigger, ship a normal file and compress it instead: see the compressor.
What is a data URI?
A data URI puts the file's MIME type and encoded content directly inside a URL, so an HTML or CSS file can reference it without a separate image request.
Why is there a file size limit?
Large Base64 strings slow down pages and are hard to maintain. This tool is designed for icons, tiny illustrations, and test data.