Image ↔ Base64

Runs in your browser 25 MB LimitImage Tools#Developer

Convert images to Base64 (data URI, CSS, <img>, Markdown) and decode Base64 back to an image file.

How to use, limits & privacy

About Image ↔ Base64

Turn an image into Base64 text for embedding in HTML, CSS, JSON or email templates, or turn Base64 back into an image you can preview and download. Output comes as a data URI, plain Base64, a CSS background, an <img> tag or Markdown. The image type is read from the file itself, so a JPEG is saved as .jpg even if the text claims PNG. Everything runs in your browser.

How to Use

1

Choose a direction

Pick Image to Base64 to encode a file, or Base64 to Image to decode text.

2

Add the image or text

Drop, paste or choose an image up to 25 MB. To decode, paste Base64 or a data URI; quotes, url(…) and line breaks are cleaned up for you, and an error explains what is wrong.

3

Copy or download

Choose Data URI, Base64, CSS, <img> or Markdown and click Copy, or Download .txt. When decoding, click Download to save the image with the right extension.

Privacy & Processing

  • Mode: local
  • Files Leave Browser: Local tool processing; review details below
  • Max Input Size: 25 MB
  • Account Required: No
  • Data Stored Locally: Nothing is saved; your image and text are cleared when you close the page.
  • Network Processing: Assets or models may require an initial download

Images and Base64 text are processed in your browser and never uploaded.

Rules & Limitations

  • Base64 text is about 33% bigger than the image file, so inline only small images such as icons and logos.
  • Output longer than 1 MB shows only its start on screen; Copy and Download .txt still include all of it.
  • Images up to 25 MB can be encoded. Very long pasted text can make the page slow.
  • Decoding recognises PNG, JPEG, GIF, WebP, SVG, BMP, ICO, TIFF, AVIF and HEIC. Some of these (such as HEIC and TIFF) can be downloaded but not previewed in every browser.

Top Suggestions

  • Embedding a small logo or icon in an HTML email or a single-file web page
  • Putting an image into CSS, JSON or a Markdown file without a separate file
  • Checking what image a Base64 string from an API or database contains
  • Saving an image that you only have as a data URI

Image ↔ Base64 FAQ

How do I convert an image to Base64?

Choose Image to Base64 and drop or paste your image. The data URI appears at once; switch to Base64, CSS, <img> or Markdown for other forms, then click Copy.

How do I convert Base64 back to an image?

Choose Base64 to Image and paste the text, with or without the data:image/…;base64, prefix. The image appears with its type, size and dimensions, and Download saves it with the correct extension.

Why is my Base64 string bigger than the image?

Base64 writes every 3 bytes as 4 text characters, so it is about a third larger than the file. That is why large photos should stay as normal image files.

What is the difference between Base64 and a data URI?

Base64 is just the encoded text. A data URI adds a prefix such as data:image/png;base64, so browsers know the type and can use it directly in src or url().

Are my images uploaded?

No. Encoding and decoding happen in your browser, and nothing is sent anywhere or stored.