Image to Base64
Turn a small image into text you can paste straight into HTML, CSS or Markdown, so the page needs no extra request. The image never leaves your browser.
Runs in your browser — nothing is uploaded.
Reading…
Loaded: ·
How to use it
- Drop an image (PNG, JPEG, WebP, GIF, SVG, AVIF…) on the box.
- Choose what you need: a data URI, an <img> tag, a CSS rule, Markdown or the bare Base64.
- Copy the result. If it is flagged as large, consider a normal image file instead.
Frequently asked questions
Is my image uploaded?
No. It is read and encoded by your browser.
When is a data URI a good idea?
For very small images (icons, tiny logos, placeholders under about 10 KB): they save a request and work in emails and single-file pages. For larger images a normal file is better.
Why is the text so long?
Base64 turns every 3 bytes into 4 characters, so the text is about a third bigger than the file. It also cannot be cached on its own and it is repeated every time it appears in your page.
Does it work for SVG?
Yes. For SVG you can often get a shorter result with a URL-encoded data URI, but Base64 works everywhere.
Do I need a Content-Security-Policy change?
If your site sets a CSP, allow data: in img-src (and in font-src or style-src as needed) or the browser will block data URI images.