Convert an image to Base64

Convert images to five Base64 code formats, or paste Base64 to recover the original image locally. The actual bytes are checked before download.

Drop your image file here or click to choose, or paste image file · processed on this device

Open in the full image editor

Image to Base64 in three steps

Convert a JPG, PNG, WebP, AVIF, BMP, or GIF image to Base64 without uploading the source. Choose a complete data URL, the raw Base64 payload, a ready-made HTML <img>, a CSS url(), or a Markdown image. You can also reverse the process: paste raw Base64 or a data URL and download the image it contains.

Base64 is an encoding format, not compression. Its text representation is usually roughly one-third larger than the original binary file, and large embedded images can make source files difficult to maintain. Data URLs are most useful for tiny icons, placeholders, self-contained demos, email templates with compatible clients, and development fixtures. Regular image files remain preferable for larger website content because browsers can cache them independently.

File reading, encoding, and decoding run in a dedicated browser worker, keeping the page responsive and the source on your device. FileGizmo displays the final character count and provides a direct copy action. The generated value is not sent to a server, logged, or stored by the tool.

A data URL embeds the image directly in the text of a document, so an HTML page, a stylesheet, or an email template can carry a picture with no separate request. For small assets such as an icon that removes a round trip, which is occasionally worth more than the bytes it costs.

It does cost bytes. Base64 makes the data roughly a third larger than the original file, and unlike a linked image it cannot be cached separately or reused across pages. Past a few kilobytes the trade stops paying and an ordinary image reference is faster.

The forward output carries the image type detected from its bytes, so it works when pasted straight into an image source or a stylesheet background. In reverse, the pasted MIME label is not trusted: the PNG, JPG, WebP, AVIF, BMP, or GIF signature decides the downloaded extension. HTML, SVG, and other non-image payloads are refused, and the existing pixel guard runs before the browser decodes the image.

Typical uses are an inline logo in an HTML email, where external images are often blocked by default, and a small icon in a single-file document that has to survive being emailed around without its assets.

Encoding happens in your browser. It is a small operation, but an unreleased asset uploaded to an encoder is still an unreleased asset sitting in somebody else’s logs.

  1. 1

    Choose an image or switch to Base64 to image

  2. 2

    Pick Data URL, raw Base64, HTML, CSS, or Markdown output

  3. 3

    Copy the code or download the safely decoded image

Frequently asked questions

What does the output include?

Choose a complete data URL, raw Base64, an HTML image, CSS url(), or a Markdown image.

Can I turn Base64 back into an image?

Yes. Paste raw Base64 or a data URL. The tool detects the real image type from its bytes, checks its pixel dimensions, and downloads the image.

Is the image uploaded?

No. File reading and encoding happen inside a local worker.

Does Base64 make files smaller?

No. Base64 is usually about one-third larger than the original binary file.

When should data URLs be used?

They suit small embedded assets; normal image files are better for larger content and browser caching.