FreeEncode · Decode

Image to Base64 Converter

Turn an image into a Base64 data URI, CSS rule or HTML tag ready to paste into your code, or decode Base64 back into an image. Your files never leave your device.

Runs in your browser. Files never leave your device.

Runs on your device — your images and data are never uploaded.

Quick answer

To convert an image to Base64, add a PNG, JPG, SVG, GIF, WebP, ICO or AVIF file, choose data URI, plain Base64, CSS, HTML img or Markdown, and copy it. To reverse it, switch to Base64 → Image and paste the text. Base64 is about 33% larger. Free, in your browser, nothing uploaded.

Step-by-Step Guide

How to convert an image to Base64

1

Add an image

Drop, paste or choose a PNG, JPG, SVG, GIF, WebP, ICO or AVIF file.

2

Pick the format

Choose a data URI, Base64 on its own, a CSS background-image rule, an HTML <img> tag or Markdown.

3

Copy it

Copy the text into your code, or switch to Base64 → Image to decode a string back into a picture.

Inline images for code, email and more

Base64 turns the bytes of an image into plain text, so a picture can live inside an HTML page, a CSS file, a JSON payload or an email template instead of being a separate download. Developers use it for small icons, loading spinners and logos, and for APIs that only accept text.

Drop an image and get it in the form you need: a full data URI with the right MIME type, the Base64 on its own, a ready-made CSS background-image rule, an HTML img tag with alt text or a Markdown image. The file is encoded exactly as it is, with no recompression, and you can see how much larger the text is than the original (about a third).

Going the other way, paste a data URI, bare Base64 or even a CSS url(...) value to see the picture it contains and save it with the right file extension. The image type is detected from the data itself, so it works even when the MIME type is missing or wrong.

Last updated

Why Use Ripify Image to Base64

Five output formats

Data URI, plain Base64, CSS background-image, HTML <img> and Markdown.

Decode too

Paste Base64 or a data URI to view and download the image.

Exact bytes

The file is encoded as is, never recompressed; the decoded image matches the original.

Any image type

PNG, JPG, GIF, WebP, SVG, ICO, AVIF and BMP, detected automatically.

Size shown

See the character count and how much Base64 adds to the file size.

Private

Runs in your browser; nothing is uploaded.

Frequently Asked Questions

Image to Base64 FAQ

How do I use a Base64 image in HTML?▼
Choose HTML <img> and copy the result; it is an img tag whose src is the data URI, e.g. <img src="data:image/png;base64,…">. Paste it into your page like any other image tag.
How do I use it in CSS?▼
Choose CSS and paste the background-image rule into your stylesheet. The image is then part of the CSS file and needs no separate request.
Why is the Base64 bigger than the image?▼
Base64 uses 4 text characters for every 3 bytes, so it is about 33% larger. That's why inlining suits small images; large ones load faster as normal files.
How do I convert Base64 back to an image?▼
Switch to Base64 → Image and paste the text. Data URIs, bare Base64, URL-safe Base64 and CSS url() values all work; the picture appears and can be downloaded.
Should I convert SVG to Base64?▼
It works, but for SVG a plain URL-encoded data URI is often smaller. Base64 is still the safest choice where only Base64 is accepted.
Is my image uploaded?▼
No. Encoding and decoding happen in your browser and nothing leaves your device.

More Free Tools from Ripify

Switching from another site? Ripify works as a free Image to Base64 alternative to favicon.io. See all alternatives