Image and Base64

Convert an image to Base64 and back

No database: AIMRAN doesn't store your files, text or results

What is Image and Base64?

Base64 is a way of writing an image as text. Developers use it to embed small icons directly in HTML, CSS, JSON or emails without needing a separate file.

This tool works both ways: you turn an image into its Base64 code to copy it, or paste some Base64 you have been given and see it as an image to download.

How to use it

  1. Choose “Image to Base64” or “Base64 to image” mode.
  2. To encode, drag in the image and choose “Data URL” or “Base64 only”.
  3. Copy the result or download it as a .txt file.
  4. To decode, paste the Base64 text or Data URL and download the resulting image.

Advantages

Technical details

Encoding produces a Data URL (data:<type>;base64,...) or just the Base64 string, and accepts any image, SVG and ICO included, up to 10 MB; above 100 KB linking the file is recommended, since Base64 increases the size by around 33%. Decoding accepts text with or without the data: prefix, ignores spaces and line breaks, supports the URL-safe alphabet (- and _) and adds any missing = padding. The image type is identified by its binary signature: PNG, JPEG, GIF, WEBP, AVIF, BMP, ICO and SVG; if it is not recognized, the type declared in the Data URL is used.

Frequently asked questions

How do I convert an image to Base64?

Choose “Image to Base64”, drag in the image and copy the result. Use “Data URL” if you are going to paste it into an HTML src or CSS.

How do I view a Base64 image?

Choose “Base64 to image” and paste the text. The image will be shown and you can download it with the right extension.

What is a Data URL?

It is Base64 with a prefix that states the type, for example data:image/png;base64,... It can be used directly as an image address.

When should I use Base64 images?

For small icons and graphics. For large images it is better to link the file, because Base64 takes up roughly a third more space.

More Image tools