Image to Base64
Turn an image file into a Base64 string or data URI for CSS and HTML.
How to use Image to Base64
- Upload an image.
- Copy the Base64 or data URI.
- Paste into CSS, HTML, or JSON.
What this tool accepts
- Raw Base64 and data URI
- Copy button
Formats: Any image the browser can read
Developers still inline 1 KB icons as data URIs to skip an extra request. This encoder never uploads the file — FileReader runs locally.
Data URI vs raw
CSS background-image needs the data:image/...;base64, prefix. Some APIs want the raw payload only. Both are shown.
Frequently asked questions
Should I inline large photos?
No. Data URIs bloat HTML. Use this for tiny icons, not hero images.