PrimeUtil

Image to Base64

Drag and drop or upload an image to get its Base64 string. Paste a Base64 string to preview the image or download it. Supports JPG, PNG, GIF, WebP.

Image

Drop an image here or click to upload

JPG, PNG, GIF, WebP, SVG

Base64 Output
Base64 output will appear here

Features

  • Drag-and-drop or click-to-upload image interface
  • Converts JPG, PNG, GIF, WebP, and SVG images
  • Shows image preview alongside the Base64 output
  • Generates both raw Base64 and full Data URL (data:image/...;base64,...)
  • Decode Base64 back to a viewable and downloadable image
  • File size information shown after encoding

Frequently Asked Questions

How do I convert an image to Base64?
Drag your image into the upload area or click to browse. The tool reads the image file in your browser and converts it to a Base64 string instantly. You can copy the result and embed it directly in HTML or CSS.
How do I embed a Base64 image in HTML?
Use the Data URL format: <img src="data:image/png;base64,YOUR_BASE64_STRING" />. Our tool provides the full Data URL with the correct MIME type prefix, ready to paste directly into your HTML or CSS.
Why convert an image to Base64?
Base64 images can be embedded directly in HTML, CSS, or JSON without needing a separate file request. This reduces HTTP requests in web pages and is useful for small icons, email templates, and configuration files that need to include images as text.
Is there a file size limit?
There is no hard limit in our tool, but very large images (over 5MB) may produce very long Base64 strings. Keep in mind that Base64 increases file size by approximately 33%, so it is best used for small images.