InTab

Image to Base64

Turn an image into a Base64 data URL, raw Base64, CSS, HTML or Markdown.

Encoders: Escape, encode and decode text. It runs in your browser, so nothing you enter is uploaded.

What it does

Image to Base64 turns an image into a Base64 data URL that you can embed directly in HTML, CSS, Markdown, JSON or an email, with no separate image file. It accepts PNG, JPG, GIF, WebP, SVG and ICO, and shows the type, size and dimensions.

How to use it

  1. Choose an image or drop it onto the page.
  2. Choose the output: Data URL, raw Base64, a CSS background-image rule, an HTML <img> tag, or Markdown.
  3. Copy the result or download it as a text file.

Example

A small icon becomes:

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

or in CSS:

.icon { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA…"); }

Good to know

  • Embedding saves a network request but makes the HTML or CSS about a third bigger, and the image can no longer be cached on its own. It suits small icons and logos (a few KB), not photos.
  • SVG files can often be embedded as plain text instead of Base64, which is smaller.
  • Some email programs block data-URL images; test before sending a campaign.

FAQ

How do I turn Base64 back into an image? Use Base64 to Image.

Is my image uploaded? No. It is read and encoded inside your browser.

Guides

More Encoders tools

  • Unicode Escape: Encode and decode JSON or XML text to Unicode escapes (\uXXXX, &#x…;).
  • Base64: Encode and decode Base64 text and files (URL-safe supported).
  • Base64 to Image: Paste Base64 or a data URL to see the image and download it.
  • URL Encoder: Percent-encode and decode URLs; parse URL parts and query parameters.
  • HTML Entities: Escape and unescape HTML entities.
  • JWT Encoder / Decoder: Decode, verify and sign JSON Web Tokens: HS, RS, PS, ES and EdDSA, with key generation.