Image to Base64

Convert images to Base64 for inlining in HTML, CSS or JSON. Drop one image or a whole folder, choose the output — data URI, raw Base64, CSS background-image, an img tag or JSON — and copy each result or download them all as a ZIP. Going the other way, paste a Base64 data URI to see the image and save it. It's free, runs in your browser, and your images never leave your device.

When to inline an image

Image sizeRecommendation
Under 2 KBInline — saves a request
2–10 KBInline only if used once on a critical page
Over 10 KBKeep as a file — it can be cached
Repeated across pagesKeep as a file

When to use it

  1. Inline small icons in an HTML email template.
  2. Embed an image in a JSON API payload or config file.
  3. Add a tiny background image to CSS without an extra request.
  4. Recover an image from a Base64 string in a log or database.

How to Use

  1. Drop one or more images.
  2. Choose the output format.
  3. Copy a result, or download all as a ZIP.
  4. To decode, open the Base64 → image tab and paste a data URI.

Features

  1. Bulk conversion
  2. Data URI, raw Base64, CSS, img tag or JSON
  3. Size before and after
  4. Large-image warning
  5. Base64 to image decoding
  6. ZIP export
  7. 100% client-side

FAQs

How do I convert an image to Base64?

Drop it here. The data URI appears instantly; choose another format from the menu if you need raw Base64, CSS or an img tag.

Does Base64 make images bigger?

Yes, by about a third. It suits small images under a few kilobytes; larger ones are better as normal files.

Which formats work?

PNG, JPG, GIF, WebP, AVIF, SVG, ICO and BMP — the file's own type is kept.

Can I convert many images at once?

Yes. Drop several files or a folder and download all the results as a ZIP.

Are my images uploaded?

No. They're encoded in your browser.

Technical Details

Each image is read with the File API as raw bytes and Base64-encoded in chunks, so large files don't hit the argument limits of a single String.fromCharCode call. The data URI uses the file's own media type, so PNG, JPEG, GIF, WebP, AVIF, ICO and SVG all render when pasted back. Output can be the full data URI, the raw Base64 payload, a CSS background-image rule, an HTML img tag or a JSON object with name and type, and many images can be converted together and downloaded as a ZIP of text files. The original and encoded sizes are shown side by side: Base64 adds about a third, and an inlined image can't be cached separately from the page or stylesheet that contains it, so a warning appears for anything over 10 KB, where a normal image file is usually the better choice. The decode tab takes a Base64 data URI, previews the image, and saves it with the right extension. Nothing is uploaded.

Developer Tools

Developer Tools

  • HTML to JSX
  • SVG to JSX Converter
  • Data URI Generator & Decoder
  • SVG to CSS Converter
  • CSS Data URI Converter
  • Basic Auth Header Generator
  • Hex Dump Viewer
  • Text Encoding Inspector