Image to Base64
Turn a small image into a Base64 data URL you can paste into HTML or CSS.
Your image is encoded locally in your browser and never uploaded.
What is image to base64?
A Base64 data URL embeds an image directly in HTML or CSS, avoiding an extra request. This tool encodes images up to 2 MB and shows the resulting string with its character count so you can judge whether embedding is sensible.
For anything larger, linking a real file is almost always the better choice — Base64 also adds ~33% size overhead.
How to use it
-
Choose a small image
Under 2 MB is recommended.
-
Copy the data URL
Paste it into a src attribute or CSS url().
Examples
Embedding in HTML
The data URL goes straight into the src attribute.
Result: <img src="data:image/png;base64,iVBORw0KGgo…" alt="">
Frequently asked questions
For tiny, frequently-used assets like icons where avoiding an extra request wins. For real photos, serve a file instead.