Embed images directly in your code
Sometimes you need an image without a separate file: an icon in a stylesheet, a logo in a single-file HTML report, a placeholder in a JSON API response, an image in a Markdown document or a background in a component library. This converter encodes any image as Base64 and formats it ready to paste — as a data URI, plain Base64, a CSS background-image, an HTML <img> tag or Markdown image syntax.
Features
- All common image formats: PNG, JPG, GIF, WebP, AVIF, SVG, ICO and more.
- Five output formats for different uses.
- Size comparison between the original file and the encoded text.
- Image preview with transparency checkerboard.
- One-click copy.
- Private: the file never leaves your browser.
Output examples
| Format | Looks like |
|---|---|
| Data URI | data:image/png;base64,iVBORw0KGgo… |
| Base64 | iVBORw0KGgo… |
| CSS | background-image: url("data:image/png;base64,…"); |
| HTML | <img src="data:image/png;base64,…" alt="logo"> |
| Markdown |  |
Keep embedded images small
Embedded images can't be cached on their own and are re-downloaded with every copy of the page or stylesheet that contains them. As a rule of thumb, embed only images smaller than a few kilobytes. Shrink images first with Compress Image, convert vector icons with SVG to PNG if a bitmap is needed, or encode other files and text with the Base64 encoder.