Convert an image to Base64
Turn an image into a Base64 data URL you can paste into HTML, CSS, JSON or an email template, or paste Base64 to get the image back. Nothing is uploaded.
Your images are encoded and decoded on this device and never uploaded. We don't see, store or log your files.
How it works
- Choose Image to Base64, then pick a PNG, JPG, WebP, GIF or SVG file.
- Copy the data URL, the bare Base64, or the ready <img> or CSS snippet.
- To go the other way, choose Base64 to image and paste the text: the image appears with a Download button.
When to embed an image as Base64
A data URL puts the image inside the page itself, which saves one request for tiny images such as icons, logos in email signatures and placeholders. Base64 makes a file about 33% larger (every 3 bytes become 4 characters): a 6 KB icon becomes about 8,000 characters. For photos and anything over about 10 KB, a normal image file is faster, because browsers can cache it and load it in parallel.
Data URL, Base64 and snippets
The data URL starts with the type, e.g. data:image/png;base64,iVBOR…, and works anywhere a URL does. The bare Base64 is the same text without that prefix, for APIs and JSON fields that ask for it. The type is read from the file's own bytes, not its name, so a PNG renamed .jpg is still labelled image/png.
Decoding Base64 back to an image
Paste a data URL or bare Base64; line breaks and spaces are ignored, and URL-safe Base64 (with - and _) works too. The image is shown on a checkerboard so transparent areas are visible, and you can download it with the right file extension. Text that isn't an image, such as Base64 of a PDF, is reported instead of shown.
Frequently asked questions
Is my image uploaded?
No. The file is read and encoded by your browser, and decoded images are created on your device. Nothing is sent to a server.
Why is the Base64 text so long?
Base64 uses 4 characters for every 3 bytes, so it is about a third bigger than the file. A 100 KB photo becomes about 136,000 characters.
Can I convert SVG to Base64?
Yes. SVG works as a data URL in browsers; for very small SVGs, percent-encoded SVG can be shorter, but Base64 is the most compatible.
Last reviewed: October 4, 2026
Related tools
- SVG to PNGConvert SVG files or pasted SVG code to sharp PNG at 1×, 2×, 4× or any width up to 8,000 px, with transparency kept. Free, no upload.
- Compress ImageCompress JPG, PNG and WebP images for free in your browser. Shrink photos for email, websites and forms without uploading them anywhere.
- Colour Picker from ImagePick any colour from a photo or screenshot and copy its HEX, RGB or HSL code, and see the image's main colours. Free, in your browser, nothing uploaded.