Image to Base64 Converter

Turn an image into a Base64 string or data URL.

FreeNo sign-upRuns in your browser

Your image

PNG, JPG, GIF, WebP or SVG, up to 5 MB. The file stays on your device.

Base64 output

Choose an image to convert

How to use it

  1. Choose an image

    Pick a PNG, JPG, GIF, WebP or SVG file up to 5 MB.

  2. Pick the output

    Data URL, plain Base64, a CSS rule or an HTML image tag.

  3. Copy and paste

    Copy the text into your code or document.

This tool converts an image into a Base64 string you can paste straight into HTML, CSS, JSON or an email. Choose a ready-made data URL, a CSS background rule or an image tag. The image is read by your browser and never uploaded.

Good to know

Small is best

Keep Base64 images under about 10 KB. Bigger ones slow the page that contains them.

No caching

A normal image file is cached by the browser. A Base64 image inside a page is downloaded again every time the page loads.

SVG tip

For simple SVG icons, you can often paste the SVG code directly instead of Base64, which is smaller.

Decode it back

Need the image back from the text? Use our Base64 Encoder and Decoder for text, or open the data URL in a browser tab.

Common questions

What is a Base64 image?
It is the image file written out as plain text. A browser can show it without loading a separate file, which is handy for small icons.
Does Base64 make the image bigger?
Yes, by about one third. That is why it suits small images and not large photos.
When should I use it?
Use it for tiny icons, email templates or single-file pages. For normal photos, a regular image file loads faster and can be cached.
Is my image uploaded?
No. The conversion happens in your browser, so private images stay on your device.
What is the file size limit?
5 MB. Larger images would make a very long string that is hard to paste anyway.

More free tools

All free tools
Base64 Encoder and Decoder

Encode text to Base64 or decode it back. Works with emoji and any language.

Runs in your browser
Image Compressor

Compress JPEG, PNG, and WebP images directly in your browser with real-time size reduction calculations.

Runs in your browser
Image Converter

Convert images between PNG, JPG, WebP, BMP and ICO in your browser.

Runs in your browser
JSON Formatter and Validator

Paste JSON to format, check or minify it. Shows the line and column of any error.

Runs in your browser