Sign in

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
Direction

Drop an image to encode

Or choose files from your device.

or paste with Ctrl+V

PNG, JPG, SVG, WebP, GIF, ICO, AVIF or any other file

How to convert an image to Base64

  1. Choose a direction

    Pick Image → Base64 to encode, or Base64 → Image to decode.

  2. Add your input

    Drop or choose an image file, or paste a Base64 string or data URI.

  3. 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.

Questions people ask

Base64 represents every 3 bytes as 4 text characters, so the encoded text is about 33% larger than the file. That's why it's best for small images.

For small icons, tiny placeholders, single-file HTML pages, email templates or JSON APIs that can't reference external files. For large photos, a normal image file is faster and can be cached.

Yes. Switch to "Base64 → Image", paste a data URI or a Base64 string, and download the decoded file. The image type is detected automatically.

No. Encoding and decoding run entirely in your browser.