Image to Base64
Convert PNG, JPG, GIF, SVG, or WebP images to base64 data URLs. Copy as <img> tag, CSS background, or raw base64. Runs locally in your browser — files never uploaded.
How It Works
Using Image to Base64 in 3 Steps
Drop or Pick an Image
Drag a file onto the dropzone or click to choose one. PNG, JPG, GIF, SVG, WebP, and AVIF are supported up to 10 MB.
See Live Stats
The tool shows the original byte size next to the encoded base64 size so you can decide whether inlining is worth it.
Copy in the Format You Need
One-click copy as raw base64, full data URL, ready-to-paste <img> tag, or CSS background rule.
Use Cases
Who Uses Image to Base64?
Email & Newsletter Designers
Inline logos and decorative icons directly into HTML emails to bypass image-blocking and broken image links.
Frontend Developers
Embed tiny icons and signatures into CSS to eliminate extra HTTP requests for above-the-fold assets.
Documentation & Storybook Authors
Bake assets into Markdown and Storybook stories so examples remain self-contained and don't depend on external URLs.
FAQ
Image to Base64 — Frequently Asked Questions
Everything you need to know before you start.
Are my images uploaded anywhere?
No. The conversion happens in your browser using the FileReader API. The file never leaves your device, making this safe for confidential or unreleased images.
When should I actually use a base64 image?
Inline base64 is ideal for tiny icons, transactional emails, or eliminating an extra HTTP request for above-the-fold images. For anything larger than ~10 KB it's usually better to keep the file external — base64 inflates size by ~33%.
Does it work with SVG?
Yes. SVGs are encoded as data URLs with the image/svg+xml MIME type and can be used directly in CSS background-image or <img> src.
What is the max file size?
10 MB. Larger files are blocked because base64 strings become unmanageable and most email and CSS contexts have lower practical limits anyway.