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.
How to convert an image to Base64
Add an image
Drop, paste or choose a PNG, JPG, SVG, GIF, WebP, ICO or AVIF file.
Pick the format
Choose a data URI, Base64 on its own, a CSS background-image rule, an HTML <img> tag or Markdown.
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.
Image to Base64 FAQ
How do I use a Base64 image in HTML?▼
How do I use it in CSS?▼
Why is the Base64 bigger than the image?▼
How do I convert Base64 back to an image?▼
Should I convert SVG to Base64?▼
Is my image uploaded?▼
More Free Tools from Ripify
Edit PDF
Fill PDF Form
Sign PDF
Merge PDF
All PDF Tools
Free Online Video Downloader
Switching from another site? Ripify works as a free Image to Base64 alternative to favicon.io. See all alternatives