Convert image to Base64
Generate a Data URL from a local image and use it directly in a stylesheet, HTML file or email. You’ll see the size of the resulting text and the increase compared to the original file.
Workspace · Base64-encoded image
How to use it
Select an image smaller than 12 MB.
Wait for the Data URL to be generated.
Copy the full text, the CSS or the HTML tag, or download the result.
Examples
CSS icon
A small icon can be used as a background-image via a Data URL, thereby avoiding an additional request.
Email prototype
An embedded image ensures that it is displayed even if the email client blocks external files.
What you need to know
Base64 encodes binary data using ASCII characters and increases the file size by approximately 33 per cent. A Data URL includes the MIME type and the encoded content, so it can be embedded directly into HTML or CSS without the need for a separate file.
Embedded images are not cached separately and increase the file size. Use them for icons, placeholders or very small resources; for large photographs, a standard cached file is usually more efficient.
Frequently Asked Questions
Related tools
Other tools that can help with similar tasks.
JPG to PNG Converter
Convert a JPG or JPEG image to PNG without uploading it.
Image compressor
Compress several JPG, PNG, WebP or AVIF images at once by quality or target size, and download a ZIP.
Check image dimensions
Check the width, height, aspect ratio, megapixels and print size of an image.
