Skip to main content
Image → Base64

Image to Base64

Turn an image into a Base64 data URI or a ready-to-paste HTML, CSS or Markdown snippet, to embed it without a separate file.

Output

Drag & drop an image here

or browse your files

or paste an image (Ctrl+V)

PNG, JPG, WebP, GIF, SVG, AVIF, ICO · Max 10 MB per file

Data URI

The result will appear here

Learn more

Images in Base64: when it makes sense

When to embed an image as Base64

For small things that must travel with the code: an icon in a single-file HTML page, a logo in an email signature or template, an image inside a JSON payload or a test fixture, a background in a CSS file you can't pair with assets. One file, no extra request, nothing to host.

When not to

Base64 is about a third bigger than the image itself, and browsers can't cache it separately from the page that holds it. Above roughly 10 KB, a normal image file usually loads faster; for photos, compress them first. Images up to 10 MB are accepted.

How it works

How to convert image to Base64

  1. Upload an image

    Drag & drop or browse to select an image file. Supports JPG, PNG, WebP, GIF, SVG, and more.

  2. Choose output format

    Choose the output: data URI, raw Base64, HTML img tag, CSS background-image or Markdown.

  3. Copy and embed

    Click Copy and paste it into your HTML, stylesheet, README or JSON — or download it as a file.

Practical guides

Tips & guides

When to use Base64

Base64-encoded images can be embedded directly in HTML or CSS, eliminating extra HTTP requests. This is especially useful for small icons, sprites, and email templates.

For inline SVG and small PNG icons (under 10 KB), Data URIs often load faster than separate file requests, improving perceived page speed.

Pro tip

Private

Your image is processed in your browser. Nothing is uploaded, stored, or tracked.

The image is encoded in your browser: the Base64 never travels through a server before you paste it yourself.

Privacy
Frequently asked questions

Frequently asked questions

Everything you need to know about Image to Base64 conversion