Image to Base64 Converter — Data URI, HTML and CSS

Convert images into Base64 data URIs with ready-to-paste HTML and CSS snippets. Free, no sign-up, and your files never leave your device.

Free, with no sign-up and no watermark. The file is processed in your browser and never uploaded.

Upload an image (PNG, JPG, GIF, WebP, SVG, ICO…) and get its Base64 data URI, the raw Base64, an <img> tag and a CSS background-image rule — each with a copy button. A preview and the before/after size help you decide whether inlining is worth it.

Step by step

  1. Upload an image: Drag it in or click to browse.
  2. Check the size: Base64 is about a third larger than the file; inline only small images.
  3. Copy the snippet you need: Data URI, Base64 only, HTML <img> or CSS background.

Handy for

Emails

Embed small logos or icons in HTML emails.

CSS icons

Inline tiny background images to save requests.

JSON payloads

Send an image inside an API request.

Single-file demos

Ship a self-contained HTML file.

Good to know

  • Some email clients block data-URI images; test before sending.

  • SVG can often be inlined directly as markup instead of Base64.

Questions

Is the image compressed?

No — the file bytes are encoded exactly. Compress it first with the image tools if it is large.

Is my data sent anywhere?

No. Everything is processed by JavaScript in your browser tab — nothing you paste or open is uploaded, logged or stored on a server. You can even use the tool offline once the page has loaded.

More Developer Tools tools

  • Base64 to Image Converter — Paste a Base64 string or data URI to preview the image, detect its type and download it.
  • URL Encoder & Decoder — Percent-encode or decode URLs and components, and break query strings into an editable table.
  • HTML Entity Encoder & Decoder — Escape text into HTML entities (named or numeric) and decode entities back to characters.
  • JWT Decoder & Verifier — Decode a JWT's header and payload with readable claims, and optionally verify its signature locally.
  • Hash Generator — Generate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes or HMACs of text and files.
  • UUID / GUID Generator — Generate random UUID v4 or time-ordered v7 identifiers in bulk, in the format you need.

All Developer Tools tools