Image to Base64 Converter – Data URL

Convert an image to a Base64 data URL for HTML, CSS or JSON — and decode Base64 back to an image.

Last updated:

Base64 to image

Image to Base64 converter

Developers and designers often need an image as text: an icon embedded in CSS, a logo inside an HTML email signature, or a picture sent in a JSON API. This image to Base64 converter turns any PNG, JPG, WebP, GIF or SVG into a Base64 data URL and gives it to you ready to paste — as a plain string, an <img> tag, a CSS background or Markdown. It also works in reverse: paste Base64 to preview and download the image. All processing happens in your browser.

How to use it

  1. Choose or paste an image.
  2. Pick the output format you need.
  3. Copy the code into your HTML, CSS, JSON or email template.

Example

A 3 KB PNG icon becomes about 4 KB of Base64 text — fine to inline in a stylesheet and save a network request. A 2 MB photo would become nearly 2.7 MB of text, so for photos, compress first with theimage compressor or keep them as files. For other encodings, see the developer tools, and convert images between formats with the image converter.

Frequently asked questions

What is a Base64 image?
An image encoded as text, usually as a “data URL” like data:image/png;base64,iVBOR… It can be placed directly inside HTML, CSS, JSON or an email template instead of linking to a separate image file.
When should I use Base64 images?
For small images such as icons, logos in email signatures, or images that must travel inside a JSON payload. For large photos it’s better to use a normal image file, because Base64 makes the data about 33% larger and can’t be cached separately.
Can I convert Base64 back to an image?
Yes — paste a data URL or a raw Base64 string into the “Base64 to image” box to preview it and download it as a file.
Is my image uploaded?
No. The conversion is done in your browser, so it’s safe for private images and internal project assets.