Image to Base64 Converter
Turn an image into a Base64 data URI you can paste into HTML, CSS or JSON, or paste Base64 to preview and download the image.
Image → Base64
Base64 → Image
🔒 Your files never leave your device. This tool runs entirely in your web browser. Nothing is uploaded to ToolsCloset or anyone else, so it’s safe for private photos, recordings and videos.
By Shah Rukh, software developer · Last updated:
How to use a Base64 image
In HTML: <img src="data:image/png;base64,iVBOR…" alt="">
In CSS: background-image: url("data:image/png;base64,iVBOR…");
When to inline images
- Good for: tiny icons and images under a few KB, email templates, and single-file HTML.
- Avoid for: photos and large images. Base64 is 33% bigger and can’t be cached separately, which slows pages.
Shrink images first with the image compressor.
Frequently asked questions
Is my image uploaded?
No. The conversion happens in your browser.
Which formats are supported?
Any image your browser can open: PNG, JPG, WebP, GIF, SVG, AVIF, BMP and ICO.
Why won’t SVG Base64 preview?
SVG can contain scripts, so SVG previews are blocked for safety. The conversion to Base64 still works.
Related tools
QR Code Generator
Free QR codes for links, Wi-Fi, text and contacts.
Color Picker & Palette
HEX, RGB and HSL codes plus matching palettes.
Contrast Checker
Check WCAG AA/AAA colour contrast for text.
Base64 Encoder / Decoder
Encode or decode Base64 text (UTF-8 safe).
URL Encoder / Decoder
Percent-encode or decode URLs and query strings.
Binary / Hex Converter
Convert between binary, octal, decimal and hex.