Skip to content

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.

It works in your browser. We do not store or send anything you type.Free · No sign-up required

Workspace · Base64-encoded image

Runs in your browser · 100% local
Files are processed in your browser; if you are signed in with history enabled, text results appear in your history.
Instructions

How to use it

01

Select an image smaller than 12 MB.

02

Wait for the Data URL to be generated.

03

Copy the full text, the CSS or the HTML tag, or download the result.

Examples

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.

Reference guide

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

Frequently Asked Questions

The tool limits the file size to 12 MB so that the resulting text remains manageable in a text editor.

Related tools

Other tools that can help with similar tasks.

More at Images→
Convert an image to Base64 and a Data URL · ByTooly