Image to Base64 Converter

Encode PNG, JPG, SVG, GIF or WebP images as Base64 data URIs, ready to paste into HTML, CSS, JSON or emails. Your images never leave your browser.

Drop an image here

PNG, JPG, GIF, WebP, SVG, ICO… any file works · nothing is uploaded

Converted on your device. Nothing is uploaded.

How to convert an image to Base64

  1. 1

    Drop an image into the box above, or click it to browse.

  2. 2

    Pick the output you need: data URI, plain Base64, a CSS background-image rule or an HTML <img> tag.

  3. 3

    Press Copy and paste it into your code.

Why use this Image to Base64 converter

Ready-made snippets

Get a complete CSS background-image rule or HTML <img> tag, not just the raw string.

Any image type

PNG, JPG, GIF, WebP, SVG, ICO and AVIF all work, and so does any other file.

Size shown upfront

See exactly how large the encoded text is before you embed it.

Private

Encoding happens on your device, so unreleased designs and assets stay private.

Popular uses for the Image to Base64 converter

Inline images in HTML emails

Embed small logos so they show without external hosting.

CSS background images

Paste a data URI straight into your stylesheet.

Store images in JSON

Send small images inside API payloads.

Fewer HTTP requests

Inline tiny icons to save network requests.

Also known as: image to Base64 converter, Base64 image encoder, image to data URI, PNG to Base64 and SVG to Base64.

People also search for

  • convert image to base64 string
  • image to data uri for css
  • png to base64 online
  • embed image in html with base64
  • jpg to base64 for email signature
  • convert large image to base64 string

A fast browser file utility for data

Convert CSV, JSON and YAML, or encode images as Base64, with a free online file converter that needs no install. It's a client-side file converter, so private data, exports and API keys stay on your device instead of being sent to a server.

Frequently asked questions

What is a Base64 image?

It's an image file written as plain text. As a data URI (data:image/png;base64,…) it can be embedded directly in HTML, CSS or JSON without a separate image file.

When should I embed images as Base64?

It's best for small images like icons and logos, where saving an extra network request matters. Base64 is about 33% larger than the original file, so large photos are better served as normal files.

How do I use a Base64 image in CSS?

Choose the CSS output and copy the background-image rule, or put the data URI inside url("…") yourself.

Are my files uploaded to a server?

No. Conversion runs entirely in your browser via client-side JavaScript, on your own device. Your files never touch a remote server and nothing is stored, so it's a secure, private, no-upload tool for personal photos and confidential data, and it keeps working on slow connections.

Related tools