Image Tools
Image and Base64 Converter
Convert an image to a Data URL, raw Base64, HTML, CSS or Markdown, or decode Base64 back to an image preview. Detects format and size; nothing is uploaded.
How to use Image and Base64 Converter
To encode, leave the top box empty, choose an image and pick an output format, then use Copy result. To decode, paste Base64 or a Data URL into the top box to preview the image and download it.
- Encode or decodeChoose an image file to encode it, or paste Base64 or a Data URL into the box to decode it.
- Pick the formatFor encoding choose Data URL, raw Base64, HTML, CSS or Markdown; raw Base64 is detected automatically.
- Copy or downloadCopy the encoded text, or check the decoded image's type, size and dimensions and download it.
Choose the output your code needs
A Data URL includes the MIME type and can go straight into an image source. Raw Base64 contains only the encoded bytes. The HTML option writes an img tag with alt, width and height attributes, and the CSS and Markdown options wrap the same Data URL in ready-to-paste code. Base64 uses four text characters for every three bytes, so it is about a third larger than the file: a 653-byte JPEG becomes 872 characters of raw Base64.
Decoding checks the real format
When decoding, the tool reads the file header to identify PNG, JPEG, GIF, WebP, SVG, BMP, ICO and AVIF images and their pixel dimensions. If the declared MIME type doesn't match the bytes, it says so and shows the image as its real type. SVG is previewed as an image, so any script inside it never runs. Files up to 10 MB are supported, and reading, encoding and decoding all happen in your browser.
Accuracy and data handling
Check clarity, colour, transparency and final file size before publishing the image. The calculation runs in your current browser; the tool code does not send the input to a processing API.
FAQ
Is the selected image uploaded?
No. Reading the file, encoding, previewing and decoding all run in the current browser tab.
Which images are supported?
PNG, JPEG, GIF, WebP, SVG, BMP, ICO and AVIF files up to 10 MB, and Base64 in standard or URL-safe form.
Why is Base64 larger than the image file?
Base64 represents every three bytes with four text characters, adding about 33% before the Data URL prefix or any HTML around it.
Should every website image be embedded as Base64?
No. It suits small icons, email templates and tests. Large embedded images bloat HTML and CSS and can't be cached separately by the browser.