Skip to main content
KalkuNet

Image to Base64 — Data URI, <img> Tag, CSS and Markdown

Convert PNG/JPG/WebP assets into copyable Data URI, <img> & CSS url() code.

Runs in your browserImage · Format Conversion & SVG

When to use the Image File to Base64 Data URI & CSS Converter

  • Small icons without extra requests

    Icons, small logos or placeholder images can be embedded straight into HTML or CSS as a data URI, so the page does not need a separate request for the file.

  • Email templates and single-file HTML

    An HTML report sent as one file or offline documentation still shows its images, because they travel inside the file. Choose the <img> format, which already includes width, height and alt.

  • Original bytes, the right MIME type

    The file is not re-encoded: the Base64 comes from its original bytes, and the MIME type comes from the content (magic bytes), not the file name. A JPG named .png is still written as image/jpeg.

  • Shorter SVG without Base64

    For SVG there is a URL-encoded data URI, usually shorter than Base64 and still readable, which suits icons in CSS.

Frequently asked questions

What is the difference between a data URI and plain Base64?

Plain Base64 is just the encoded text. A data URI adds a prefix such as data:image/png;base64, so the browser knows what the data is and can use it directly in src or url().

Is my image uploaded?

No. The file is read and encoded in your browser; nothing is sent to a server.

How do I use the result in CSS?

Choose the CSS tab to get a background-image: url("…"); line ready to paste into a rule. For SVG icons, URL encoding usually gives smaller CSS.

How do I turn Base64 back into an image?

Use Base64 to Image: paste the text, check the preview, then download the original file or save it as PNG, JPG or WebP.

Learn more