What a data URL is
A Base64 data URL is your image written as text. Paste it into an img tag or a CSS rule and the browser shows the image without asking a server for a file. One request fewer, per page load, per icon.
When it is worth it
| Use it | Skip it |
|---|---|
| Small icons and badges | Photos |
| Logos on every page | Anything over 100 KB |
| Images in a single-file HTML | Emails (many clients block them) |
| Backgrounds in CSS themes | Images that change often |
Base64 makes a file about a third bigger than its binary form. On a small icon that cost is nothing next to a saved network request. On a photograph it slows the page down for no benefit.
Quick steps
- Open the image to Base64 tool.
- Drop the image in. The size cost shows straight away.
- Copy the data URL, the raw Base64, or the ready-made HTML and CSS.
The forms you can copy
The tool gives all four, so you never hand-edit:
- The full data URL, for
srcattributes - Raw Base64, for JSON payloads and APIs
- A ready
<img>tag - A ready CSS
background-imagerule
Watch the cache
A normal image file is cached by the browser on its own. A data URL rides inside the HTML, so it re-downloads with every page load. That is the trade: fewer requests, but no separate caching. Icons used on every page are the sweet spot.
Making the icon first
Turning a logo into a favicon-sized icon? SVG to ICO makes the favicon file, and the Base64 tool embeds a copy where a file request is not wanted.
Found this useful? Browse the free tools or suggest the next guide.