Image Data URI Converter β Encode Images for HTML
Create an image data URI for embedding in HTML or CSS. Copy the original image bytes as Base64 with a MIME prefix, or copy raw Base64.
Choose an image or drop it here
PNG Β· JPG Β· GIF Β· WebP Β· BMP Β· AVIF Β· up to 10 MB Β· local processingOriginal image bytes are preserved. Decoding restores the original format; it does not convert formats. Up to 10 MB and 32 million pixels. GIF preview may animate.
π100% Private β Your files never leave your device. All processing runs locally in your browser.
How It Works
Convert an image to Base64 or restore an image from standard Base64 or a data URI. Preview the image and copy either the data URI or raw Base64.
Encoding preserves the original image bytes. Decoding identifies the image format from its bytes and saves the original format with the correct filename extension.
Features
- βImage encoding and decoding
- βRaw Base64 or image data URI input
- βOriginal image bytes preserved
- βCorrect original-format download
- βLocal processing, up to 10 MB
How to Use This Tool
- Choose Image to Base64 or Base64 to image.
- Select an image or paste Base64.
- Encode automatically or choose Decode image.
- Copy the encoding or download the decoded image.
Perfect For
- βEmbed a small image in HTML
- βRead an API image payload
- βRestore an image data URI
Frequently Asked Questions
PNG, JPG, GIF, WebP, BMP and AVIF, when your browser can decode them. SVG and other file types are not accepted.
No. It restores the original bytes and format. Use the image converter to change formats.
Yes. The image type is read from the decoded bytes. Standard Base64 accepts spaces, line breaks and omitted padding; URL-safe Base64 is not supported.
Malformed Base64, a type that does not match the image bytes, unsupported image data or an unreadable image will produce an error.
Up to 10 MB of original image data and 32 million pixels. Base64 increases the encoded size by roughly one third. Conversion stays in your browser.