Image to Base64 Converter
Embed a small image straight into HTML, CSS, JSON or an email template. Choose an image and copy it as a data URL, as plain Base64, or as a ready-made CSS, HTML or Markdown snippet.
How to convert an image to Base64
- 1Click “Choose an image” or drop one onto the page.
- 2Pick the format you need: data URL, Base64, CSS, HTML or Markdown.
- 3Click Copy next to it.
When to embed
Data URLs suit small icons and logos: they save a request, but they're about a third bigger than the file and can't be cached separately. For photos and anything over a few kilobytes, a normal image file is usually better.
SVG without Base64
SVG is text, so it can go into a data URL with only a few characters escaped. That version is usually smaller than Base64 and is offered separately for SVG files.
Details at a glance
You see the image's type, its width and height in pixels, and its size before and after encoding.
Frequently asked questions
- Is my image uploaded?
- No. It's encoded in your browser and never leaves your device.
- Which formats work?
- Any image your browser opens: PNG, JPG, GIF, WebP, AVIF, SVG, ICO and more, up to 25 MB.
- How do I turn Base64 back into an image?
- Use Base64 to Image: paste the text and download the picture.