Image to Base64

Turn an image into a Base64 data URI for HTML or CSS.

Runs in your browser · nothing uploadedNo watermark

About Image to Base64

Image to Base64 converts a picture into a data URI, a text string that starts with data:image and contains the whole file. You can paste it into HTML, CSS or an email template so the image loads without a separate file. The tool also gives you a ready img tag with the data URI as its source, and a preview of the picture.

Use it for small icons, logos and placeholders. Base64 makes the data larger by roughly a third, and the tool shows the size before and after. Images must be under 8 MB. You can also paste an existing data URI to preview the image it contains. The conversion happens in your browser and nothing is uploaded.

How to use Image to Base64

  1. 01

    Drop an image.

  2. 02

    Copy the data URI or HTML snippet.

  3. 03

    Or paste a data URI to preview it.

When to use it

  • Embedding a small icon directly in a CSS file as a background image.
  • Inlining a logo in an HTML email so it does not depend on a link.
  • Putting a tiny placeholder image inside a single self-contained HTML page.
  • Previewing a data URI from a database, API response or log to see what it shows.
  • Passing an image as text in a JSON payload or a test fixture.

Frequently asked questions

How do I convert an image to Base64?

Drop the image into the tool. It shows the data URI in a text box and an HTML img snippet below it. Copy either one with the copy button and paste it where you need it.

How much bigger does a Base64 image get?

Base64 text is about 33 percent larger than the original file, plus the data URI prefix. The tool shows the original size, the new size and the percentage increase for your image.

When should I use Base64 images?

They suit tiny icons in CSS, HTML emails and self-contained pages. Large photos are better served as normal files, because Base64 cannot be cached separately and increases page size.

Is there a size limit for the image?

Yes. Images must be smaller than 8 MB. For much smaller output, compress or resize the picture first with the image compressor or resizer, then convert it.

Can I turn a Base64 string back into an image?

You can preview it. Paste a data URI that starts with data:image and ends with Base64 content into the paste box, and the picture appears. There is no separate download for the decoded file.

Is my image uploaded to a server?

No. The file is read and encoded in your browser, so the image and the resulting string stay on your device and are not sent to i40x.

More Image Tools

View all

Other categories