# Image to Base64 Converter — Copy a Data URI

> Convert a small image to a Base64 data URI for HTML and CSS without uploading it.

Source: https://toolpantry.app/image-to-base64

## About

Turn a small image into a data URI you can paste into HTML, CSS, or a JSON fixture. Everything happens locally.

## Quick answer

**How do I convert an image to Base64?** Upload a small image and copy the data URI for use in HTML or CSS.

## How to convert an image to Base64

1. **Add a small image** — a logo or icon.
2. **Copy the data URI** — the full data:image/png;base64,… string.
3. **Paste it into CSS or HTML** — no extra request, no external file.

## Where Base64 images make sense

- Tiny icons embedded in a CSS file
- Single-file HTML demos and prototypes
- Contexts that cannot reference external files at all

## Good to know

Base64 inflates an image by about a third and blocks parallel downloads — it is a tool for small assets under ~10 KB, not for photos. For anything bigger, ship a normal file and compress it instead: see the [compressor](https://toolpantry.app/compress-image-to-100kb).

## Notes

Base64 makes files larger than their binary form, so it is usually best for small images rather than photographs.

## FAQ

**What is a data URI?**

A data URI puts the file's MIME type and encoded content directly inside a URL, so an HTML or CSS file can reference it without a separate image request.

**Why is there a file size limit?**

Large Base64 strings slow down pages and are hard to maintain. This tool is designed for icons, tiny illustrations, and test data.
