Tool
Image to Base64
Convert PNG, JPG, WebP, SVG, and GIF to Base64 data URIs. Output as raw, Data URI, CSS, HTML, Markdown, or JSON - all in your browser.
How it works
From image to code in three steps
Drop an image, pick the output format that fits your code, and copy. Nothing is uploaded anywhere.
Drop your image
Pick any PNG, JPG, WebP, SVG, or GIF. There is no file size limit since nothing leaves your browser.
Choose an output format
Pick from raw Base64, Data URI, a CSS background rule, an HTML img tag, Markdown image syntax, or a JSON value. Each tab shows ready-to-use code.
Copy and paste
Hit the copy button and paste straight into your code. No CDN, no file hosting, no extra HTTP requests needed.
Output formats
Six ready-to-use formats
Each tab in the tool gives you a different output. Here is when to reach for each one.
FAQ
Frequently asked questions
Common questions about Base64 encoding and data URIs.