Useful Hacks

Image to Base64

Encode an image as a Base64 data URI, with ready-to-paste CSS and HTML snippets.

Processed entirely in your browser. Your image is never uploaded to a server.
  • Four output shapes: data URI, raw Base64, CSS rule, <img> tag.
  • Shows the decoded size and the text size so you can judge the trade-off.
  • Works with PNG, JPG, WebP, GIF, SVG and ICO.
  • Runs in your browser — the image is never uploaded.

Overview

Turn an image file into a Base64 string you can inline directly in CSS, HTML or JSON — no separate file, no extra request. Get the full data URI, the raw Base64, a CSS background-image rule or an <img> tag, and copy or download any of them. Everything is encoded locally in your browser.

How to use it

  1. 1Add an image (small icons and logos work best).
  2. 2Pick the output shape.
  3. 3Copy it, or download it as a .txt file.

Frequently asked questions

Related guides

Related tools

All image tools

Ready to use Image to Base64?

Image to Base64

Search tools

Search for any tool by name, category or keyword