UTILS.
Private by default
🖼

Image to Base64

Convert an image file to a Base64 data URI you can paste into CSS or HTML.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
Drop an image here or click to choose

About this tool

Encode any image as a Base64 data URI entirely in your browser — the file never leaves your device.

Choose or drop a JPEG, PNG, WebP, GIF, BMP or SVG file of up to 25 MB, 16 megapixels and 8,192 pixels per side. The file is first opened as an image to confirm it is one, then its original bytes are encoded with no resizing or recompression, so a GIF stays animated and an SVG stays vector. A file that fails the check shows an error and no data URI.

The stats show the file size and the data URI length in characters, including the data: prefix. The URI sits in a read-only box and Copy copies the full string. Nothing is uploaded.

Frequently asked questions

Is my image uploaded anywhere?
No. The file is read locally with FileReader and converted in your browser; nothing is sent to a server.
Why is the data URI larger than the file?
Base64 encoding adds about 33% overhead, so the resulting text is bigger than the original binary image.
Why was my file rejected?
The check reads the file's contents, not its name, so a document renamed to .png is refused. It must be a real image within the size limits.
Is the image compressed or resized first?
No. The bytes are encoded as they are; the only size change is the Base64 expansion.

More tools