🔣 Image to Base64
Convert images to Base64 / Data URI for email signatures and HTML.
Upload an image to convert it to Base64 automatically; paste a Base64 code (full Data URI or raw code) into the box below to restore the image automatically.
📁 Upload image
Or drag images here
Supports JPG, PNG, GIF, WebP, and more
Ready: upload an image to convert it to Base64, or paste a Base64 code to restore the image.
👁️ Image preview
Shows after you upload an image or paste a code
📊 File info
📝 Base64 code
How to use Image to Base64
Follow the steps to get it done
Upload an image or paste a Base64 string
Open the page and start — no registration or sign-in needed.
It converts both ways automatically and shows a preview
Settings can be changed at any time; all computation happens in your browser.
Copy the code or download the image
Copy or download the result when you are done. Nothing is kept on this site.
Page Actions
Click to choose a file, or drag an image into the upload area. Supports JPG/PNG/GIF/WebP/BMP/SVG and converts it to Base64 automatically.
After upload, the upload area becomes a file info card (image thumbnail, file name, size, and format). Hovering the card shows a translucent overlay reading “Click or drag a new file here to replace it”. Clicking anywhere on the card or dragging in a new image replaces the current image and regenerates the code and preview.
The code appears automatically after upload. You can also paste Base64 directly (a full Data URI or a bare code) and it is decoded back into an image.
Click “📋 Copy” to copy the full Data URI in the code box in one click (including the data:image/…;base64, prefix).
The “🗑️ Clear” button next to the code box clears the preview, file info, and code, and restores the initial state.
The “⬇️ Download image” button downloads the current image (the one you uploaded, or the one decoded from a pasted code) as a file.
Shows the current image on the left; it updates automatically after an upload or a paste.
Shows the file name, original size, image format, and the size of the Base64 code.
How to Let AI Use It
Follow the steps to operate the browser page — no API key needed
There is no MCP tool for this one. Let an AI assistant follow these steps to operate the browser page (button IDs and labels match the workbench above):
- Open the tool page https://tools.waoww.com/tools/image-to-base64/
- Click the “📁 Click to choose a file” button (#b64SelectBtn) in the upload area to pick an image, or drag an image straight onto the upload area (#b64DropZone). You can also paste a Base64 string directly into the code box (#base64Result) to decode it back into an image.
- The upload generates a Base64 Data URI automatically, and the file info appears in the file name (#fileName), size (#fileSize), format (#fileType), and encoded size (#base64Size).
- Click “Copy” (#copyBtn) to copy the full Data URI, or “⬇️ Download image” (#downloadImgBtn) to download the image. Click “Clear” (#clearBtn) to start over.
Example prompt (send it to your AI assistant as-is)
「Open tools.waoww.com/tools/image-to-base64/, convert this logo image to Base64, and copy the code for me」
How It Works & Highlights
How it works, and where it fits
Image to Base64: FileReader.readAsDataURL reads the image binary locally in the browser and turns it into a Data URI. Base64 to image: the MIME type in the Data URI is parsed and the code is checked for validity, then the browser decodes and renders it natively. A Base64 string is about 4/3 the size of the original image. Everything runs locally, with no upload.
Highlights
- ✓ One flow converts both ways: upload an image to get the code, paste a code to get the image, no mode switching
- ✓ Converted locally; images are never uploaded
- ✓ Generates a standard Data URI prefix automatically, ready to paste into HTML/CSS
- ✓ Shows the original size and the encoded size live, so the growth is visible at a glance
Tips
- 💡 Inlining a small icon as Base64 saves HTTP requests, but do not inline anything over 100KB
- 💡 Inline a small logo in email as Base64 to avoid it being blocked; use attachments for large images
- 💡 Compress images over 10MB before converting, so the browser does not lag
- 💡 If Base64 copied from elsewhere has no data:image prefix, the tool treats it as PNG, so add the prefix back for JPG
FAQ
Privacy, format limits, and usage tips