Convert Image to Base64
Turn any image into a Base64 data URI, ready-made CSS background, HTML img tag or Markdown. Instant and private.
Image
Drop an image, or click to choose
Encoded on your device — nothing is uploaded.
Base64 output
How to use the Image to Base64
- 1
Drop in an image, or click to choose one.
- 2
Pick the output you want: raw data URI, CSS background, HTML img tag or Markdown.
- 3
Copy the result straight into your stylesheet or template.
Frequently asked questions
When should I inline an image as Base64?
Only for small assets — icons, sprites, tiny logos. Base64 makes a file about 33% larger and it cannot be cached separately from the page, so inlining a large photo makes your site slower, not faster. A warning appears here once the encoded text passes roughly 400 KB.
Does this work with SVG and HEIC?
Yes. Any file your browser can read is encoded byte-for-byte, including SVG, HEIC and animated GIFs, and the correct MIME type is written into the data URI for you.
Is my data uploaded to a server?
No. Every tool on this site runs entirely inside your browser using JavaScript. Your input never leaves your device and is never sent over the network, which means it is safe to paste production data, API responses and tokens.