Image to Data URI
Convert any image file to a Base64-encoded data URI string for inline embedding.
Supports PNG, JPEG, WebP, SVG, GIF. The file is read locally — nothing is uploaded.
Upload an image to generate its data URI.
Related Tools
FAQ
- What is a data URI?
- A data URI (data URL) embeds file content directly in a URL string, encoded as Base64. For images, the format is data:image/png;base64,<encoded-data>. This lets you embed images directly in HTML src attributes or CSS background-image values without a separate file request.
- When should I use data URIs for images?
- Data URIs are best for small images (icons, logos) where avoiding an extra HTTP request outweighs the overhead of inline encoding. For large images they increase HTML/CSS file size significantly and can hurt performance.
- What is the typical size increase from Base64 encoding?
- Base64 encoding increases file size by approximately 33%. For example, a 10 KB image becomes roughly 13–14 KB as a data URI string.
Upload any image (PNG, JPEG, WebP, SVG, GIF) and convert it to a Base64-encoded data URI in the format data:image/png;base64,.... The full URI is displayed in a textarea with a one-click copy button. The tool also shows the character length of the resulting string so you can assess suitability for inline embedding in HTML or CSS.