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.

Why this is private

  • Processed entirely in your browser. Your image is never uploaded to a server.
  • Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
  • Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.

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

What people use it for

Inline a small icon in CSSEmbed a tiny sprite or bullet as a data URI so it costs no extra HTTP request.
Ship a logo inside a single-file HTML exportPut the image in the markup itself for an email template or a standalone page.
Put an image in a JSON payload or configEncode a small asset as Base64 to pass it through an API or store it as a string.

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