Image to Base64 converter
Turn an image into a Base64 data URI you can paste straight into HTML, CSS, JSON or email templates - or paste Base64 and get the image file back.
- Free, no sign-up
- Nothing is uploaded
- No watermark
Drop an image to encode
Or choose files from your device.
or paste with Ctrl+VPNG, JPG, SVG, WebP, GIF, ICO, AVIF or any other file
How to convert an image to Base64
- Choose a direction
Pick Image → Base64 to encode, or Base64 → Image to decode.
- Add your input
Drop or choose an image file, or paste a Base64 string or data URI.
- Copy or download
Copy the data URI, raw Base64, HTML, CSS or Markdown snippet - or download the decoded image.
About this tool
Base64 encoding turns the bytes of an image into plain text, and a data URI (data:image/png;base64,…) lets you embed that text directly in a web page, stylesheet, JSON payload or email template instead of linking to a separate file. It's useful for small icons, placeholders and single-file HTML documents because it saves an extra network request.
The encoder reads your file exactly as it is - no re-compression - and gives you the raw Base64 string, a full data URI, an HTML <img> tag, a CSS background-image rule and a Markdown image, each with a copy button. Base64 makes data about 33% larger than the original file, so it's best kept for images under roughly 10-20 KB; larger images are usually better served as normal files. The decoder accepts a data URI, a bare Base64 string (standard or URL-safe), or even a CSS url(…) snippet, detects the real image type from its first bytes, shows a preview and lets you download the file. All encoding and decoding happens in your browser.