Image to Base64 Converter
Turn an image into a Base64 string or data URL.
Your image
PNG, JPG, GIF, WebP or SVG, up to 5 MB. The file stays on your device.
Base64 output
How to use it
- Choose an image
Pick a PNG, JPG, GIF, WebP or SVG file up to 5 MB.
- Pick the output
Data URL, plain Base64, a CSS rule or an HTML image tag.
- 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
Keep Base64 images under about 10 KB. Bigger ones slow the page that contains them.
A normal image file is cached by the browser. A Base64 image inside a page is downloaded again every time the page loads.
For simple SVG icons, you can often paste the SVG code directly instead of Base64, which is smaller.
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?
Does Base64 make the image bigger?
When should I use it?
Is my image uploaded?
What is the file size limit?
More free tools
Encode text to Base64 or decode it back. Works with emoji and any language.
Runs in your browserCompress JPEG, PNG, and WebP images directly in your browser with real-time size reduction calculations.
Runs in your browserConvert images between PNG, JPG, WebP, BMP and ICO in your browser.
Runs in your browserPaste JSON to format, check or minify it. Shows the line and column of any error.
Runs in your browser