7 min read
2026-01-28
Base64 is a way of representing binary data (images) as a text string. The encoded image can be embedded directly in HTML, CSS or JSON without a separate file.
The encoded image is used in Data URI format:
`data:image/png;base64,iVBORw0KGgo...`
Structure: `data:[type];base64,[data]`
Reducing HTTP requests to the server
Independence from external files
Convenience for small icons and illustrations
Size increases by ~33%
Not cached by the browser as a separate file
Slows down HTML loading for large images
Open [Base64 Image](/tools/image-to-base64)
Upload an image or paste a Base64 string
Copy the result in the desired format
Paste in HTML, CSS or send via API
| Image Size | Recommendation |
|---|---|
| Up to 2 KB | Feel free to encode in Base64 |
| 2-10 KB | Acceptable for critical resources |
| More than 10 KB | It's better to use a separate file |
See also: Image compression, Favicon generator, SVG editor