Base64 is too long
Base64 is usually about one third larger than the original image.
Compress the image first and only inline small assets.
Convert images to Data URLs or pure Base64, and restore Base64 back to an image preview. Files and encoded text stay in your browser with no upload.
Image to Base64 converts images into Data URLs or pure Base64 and can restore Base64 text into a previewable image. It is useful for inline icons, API fields and test data without uploads.
Base64 is usually about one third larger than the original image.
Compress the image first and only inline small assets.
The encoded body alone does not tell the browser whether it is PNG, SVG or another format.
Use a full Data URL when the result must preview or embed directly.
The Data URL prefix may be missing or the encoded content may be truncated.
Paste the complete Data URL when possible.
Choose the output format based on where you need to use it.
| Format | Shape | Best for | Notes |
|---|---|---|---|
| Data URL | data:image/png;base64,... | HTML img src, CSS url, inline icons | Includes MIME type and works directly as an image source |
| Pure Base64 | iVBORw0KGgo... | API fields, database values, custom wrappers | Does not carry MIME type by itself |
| Base64 to image | Paste encoded text and preview | Checking API results or restoring fixtures | Pure Base64 defaults to an image/png wrapper for preview |
| Original file | JPG/PNG/WebP/SVG/GIF | Long-term storage and large web assets | Large files should not usually be inlined |
logo.svg · image/svg+xml
data:image/svg+xml;base64,PHN2ZyB4bWxucz0iLi4u
Data URLs work directly in img src; pure Base64 is better for API fields.
Convert small SVG or PNG assets into Data URLs for quick embedding.
Verify whether a Base64 image returned by an API can be restored.
Embed a small image in JSON mocks, email templates or rich text tests.
No. Files are read and converted locally in your browser.
A Data URL includes the MIME prefix and can be used directly as an image source. Pure Base64 is only the encoded content.
Base64 text is usually about one third larger than the original binary file.
Yes. You can upload SVG files and generate a Data URL, or preview a valid SVG Data URL on restore.
Yes. Paste the encoded string, check the preview and click Download image.
The tool wraps pure Base64 as image/png for preview. Use a full Data URL when you know the real type.
Usually no. Large Base64 strings are heavy to copy and embed. Compress images first when possible.
No. It stays in the current browser page and is not saved to a database.