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
- Choose “Image to Base64” or “Base64 to image” mode.
- To encode, drag in the image and choose “Data URL” or “Base64 only”.
- Copy the result or download it as a .txt file.
- To decode, paste the Base64 text or Data URL and download the resulting image.
Advantages
- Works in both directions on the same page.
- Output as a Data URL ready for HTML and CSS, or as plain Base64.
- Detects the image's real format when decoding.
- Accepts Base64 with line breaks and the URL-safe variant.
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
- Compress image · Reduce file size with quality control and a before/after comparison
- Resize · Change the size in pixels or percent, also in batches
- Crop · Crop with presets for Instagram, stories, YouTube or a custom size
- Convert format · Convert between JPG, PNG, WEBP, AVIF, HEIC, TIFF, PSD, ICO, PDF and more
- Remove background · Remove a photo’s background with AI
- Rotate and flip · Rotate 90/180/270 degrees and flip horizontally or vertically
- Filters and adjustments · Brightness, contrast, saturation, black and white and blur
- Watermark · Text or logo on several images at once