Skip to content

Image to Base64

Turn an image into a Base64 data URI, with ready-to-paste HTML, CSS and Markdown.

Drag an image here, or choose one

PNG, JPG, WebP, GIF or SVG. It's read on your device — nothing is uploaded.

Runs in your browser — nothing you enter is sent to a server.

How the Image to Base64 works

Choose an image and get it as a Base64 data URI — the whole file written as text — plus snippets to paste into HTML, CSS or Markdown. The image is read in your browser and never uploaded.

Embedding saves a network request, which suits small icons and images in emails or single-file pages. Base64 text is about a third larger than the file and can't be cached separately, so link larger images as normal files.

Formula

Base64 length = 4 × ⌈bytes ÷ 3⌉

Every 3 bytes become 4 characters — a 33% increase.

Examples

A 3 KB icon

3,000 bytes become 4,000 characters of Base64.

In HTML

<img src="data:image/png;base64,iVBOR…" alt="logo">

Frequently asked questions

When should I embed images as Base64?

For tiny images (a few KB) and places that can't load external files, such as some emails. Avoid it for photos.

Do emails show Base64 images?

Many clients do, but some (notably Gmail) block data URIs. Test in the clients your readers use.

How do I turn Base64 back into text or a file?

For text, use the Base64 Encoder & Decoder. Pasting a data URI into a browser address bar shows the image.

Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 to text, with full Unicode support and URL-safe output.

Developer Tools

Image Format Converter

Convert images between PNG, JPG and WebP, with a background color for transparent areas.

Image Tools

Favicon Generator

Create a complete favicon set — favicon.ico, PNGs, Apple and Android icons — plus the HTML to add them.

Image Tools