About This Tool
This tool outputs complete text in the form data:<image-type>;base64,... It carries image content as text for small icons, presentations, and HTML or CSS that supports Data URIs.
How to Use
- Select or drag in a JPG, PNG, WebP, GIF, BMP, or SVG image.
- Check the image type, file size, and preview.
- Click “Generate Data URI” to see the complete text and its length.
- Click “Copy Data URI” or “Download TXT,” then use the result as supported by your target app.
Supported Formats
- Input: JPG, PNG, WebP, GIF, BMP, or SVG. Maximum original file size: 20 MiB.
- Output: a Base64 Data URI with the image’s actual MIME type (.txt).
Conversion Details
- A Data URI includes the data: prefix, image type, ;base64, marker, and the original image’s Base64 text.
- Encoding does not recompress the image; the original file contents stay unchanged. The text is usually about 33% larger than the file, plus a little more for the prefix.
- Data URIs increase the size of HTML, CSS, or documents and are not suited to large images. The target app may also limit their length or block embedded images.
- SVG previews exclude scripts and external resources, but the output still contains the original SVG content. Use it only if you trust the file’s source.
Maximum original image size: 20 MiB. Previews support up to 40 million pixels and 16,384 pixels per side. SVG must use UTF-8, with source content no larger than 2 MiB.
Privacy
Images are processed entirely in your browser and are never uploaded to a server.
This tool does not automatically save your selected image or result. Download or copy anything you want to keep before clearing the page or leaving.
FAQ
What is a Data URI?
It is text containing both the file type and its contents, such as data:image/png;base64,... It can represent an image wherever Data URIs are supported.
Can I put a Data URI directly in HTML or CSS?
You can use it as an image URL or background image where Data URIs are supported. The target website, app, or content rules may restrict this use.
Why isn’t this suitable for large images?
Base64 increases data size by about one-third. The full text also makes HTML, CSS, or documents larger, affecting editing and loading.
How is it different from plain Base64?
A Data URI also includes the data: prefix and image MIME type. If you need only plain Base64, use Image → Base64.
Does generating a Data URI change the image?
No. It encodes the original file contents without recompressing the image or removing any existing file information.
Are my images uploaded to a server?
No. Selection, preview, conversion, and download all happen in your browser. Your images are never uploaded to a server.