Image utilities
Image to Base64 Converter
Turn image files into exact Base64, data URLs and ready-to-copy HTML, CSS or JSON. Compare the encoded size and export several images together.
Local conversion. Original image bytes preserved.
1. Choose images
PNG, JPEG, GIF, WebP, BMP and ICO (up to 256 icon entries). Up to 8 files, 5 MiB each and 10 MiB combined. 1 MiB = 1,048,576 bytes.
Drop images here
Or focus this area and paste an image with Ctrl+V or Command+V.
No images selected.
A new selection replaces the current batch. Images are read as bytes and never rendered on this page. SVG and other formats are not supported.
2. Use the result
Choose your images, then select Convert images. Results will appear here.
- Detected MIME type
- Original size
- Raw Base64 characters
- Data URL characters
Up to 300 UTF-16 code units. Most characters use one; many emoji use two. Describe an informative image; leave blank only if it is decorative. This description applies to the selected HTML output.
Batch JSON contains each file's name, detected MIME type, original byte count and raw Base64. HTML descriptions are not included.
Ready. Select local images to begin.
How to convert an image to Base64
- Choose, drop or paste supported image files. Select Convert images to process the batch.
- Choose a converted image and check its detected MIME type and size. A filename or browser MIME mismatch is shown as a warning.
- Select an output format, then copy it or download it as text. Export batch JSON when you need every successful conversion together.
Which output should I use?
Data URL includes the image type and can be used where an image URL is accepted: data:image/png;base64,.... Raw Base64 contains only encoded bytes for APIs that request them. HTML image includes an escaped alt description. CSS background creates a background-image declaration. JSON keeps the name, MIME type, byte count and Base64 in separate fields.
Why is the output larger?
For an original file of n bytes, padded Base64 contains exactly 4 × ceil(n / 3) ASCII characters. That is approximately 33% more data for larger files and can be proportionally more for very small files. A data URL adds its MIME prefix. The size comparison is before HTTP compression; text downloads containing a Unicode filename or description can use more bytes than characters.
Inline images can be convenient for small icons or self-contained documents. Large images increase the HTML or CSS payload and cannot be cached separately. The destination's Content Security Policy must allow image data URLs, and some email clients or applications reject them. Base64 does not improve image quality, compress files, encrypt data or bypass destination restrictions.
What is checked, and what stays unchanged?
This tool matches supported file signatures and checks basic header bounds. It does not decode the pixels, verify every image structure or scan for malicious content. A signature match is not proof that the image is complete, safe or displayable. No image preview is loaded, so large pixel dimensions do not trigger image decoding here.
The exact original bytes are encoded. Animation, color profiles, EXIF information and other embedded metadata stay in the output, including location information if the original contains it. SVG, AVIF, HEIC, TIFF, cursor files and unidentified data are rejected. Export a trusted source as a supported raster format if needed.
Privacy and limits
Conversion happens in this page's memory. The converter does not upload files, fetch remote URLs, access storage or send filenames or image data to analytics. Copying writes the chosen text to your clipboard; downloading saves a file to your device. Clear all removes the tool's current selection and results, but does not erase copies or downloads. Normal site assets and page analytics are managed by the shared site shell.
Limits are 8 files per selection, 5 MiB per file, 10 MiB combined and 256 entries per ICO file. Files are processed one at a time, with a 15-second read timeout. If reading fails, select a local copy again. Clipboard or download restrictions may require selecting and copying the text manually.
Technical references: RFC 4648 Base64, RFC 2397 data URLs and WHATWG image signatures.