🔣 Image to Base64

Processed locally in the browser · nothing uploaded AI-Ready

Convert images to Base64 / Data URI for email signatures and HTML.

1 Upload an image or paste a code
→
2 Automatic two-way conversion
→
3 Copy or download

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

📷 Image
🖼️

Shows after you upload an image or paste a code

📊 File info

File name -
Original size -
Image format -
Base64 size -

📝 Base64 code

✅Copied!

How to use Image to Base64

Follow the steps to get it done

1

Upload an image or paste a Base64 string

Open the page and start — no registration or sign-in needed.

2

It converts both ways automatically and shows a preview

Settings can be changed at any time; all computation happens in your browser.

3

Copy the code or download the image

Copy or download the result when you are done. Nothing is kept on this site.

Page Actions

Upload area (click / drag and drop)

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.

Pick a different image

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.

Base64 code box

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.

Copy

Click “📋 Copy” to copy the full Data URI in the code box in one click (including the data:image/…;base64, prefix).

Clear

The “🗑️ Clear” button next to the code box clears the preview, file info, and code, and restores the initial state.

Download image

The “⬇️ Download image” button downloads the current image (the one you uploaded, or the one decoded from a pasted code) as a file.

Image preview

Shows the current image on the left; it updates automatically after an upload or a paste.

File info

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):

  1. Open the tool page https://tools.waoww.com/tools/image-to-base64/
  2. 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.
  3. 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).
  4. 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

JPG, PNG, GIF, WebP, BMP, and SVG. The format is detected automatically after upload.
No. FileReader reads the image into a Data URI locally in the browser. Nothing is uploaded.
A single file must be no larger than 10MB; oversized files are rejected with a prompt to compress first. A Base64 string is about 4/3 the size of the original image.
About 4/3 of the original. The page shows the original size and the encoded size live, so you can see the growth directly.
Copy the full Data URI and paste it straight into an HTML image URL or a CSS background. Inlining a small icon saves requests, but do not inline anything over 100KB.
Make sure you dropped an image file no larger than 10MB. If it still does nothing, use the upload area button to pick the file instead.
No. The tool handles one image at a time; convert multiple images one by one.
Yes. A full Data URI starts with the image format, which identifies the type. If the code you paste has no prefix, the tool treats it as PNG, so add the prefix back for JPG.
Any recent browser works (Chrome, Edge, Firefox, or Safari from the last three years). It works on phones too, but batch file handling and table checks are more efficient on a large screen.
Refresh the page first (resources may be cached by the browser), then check that the file format and size match the hints on the page. If it still fails, send the steps to reproduce via 「Feedback」 in the top bar.
The image as a Base64 Data URI, copyable in one click. Paste the code back to restore and download the image.
Yes, once the page has loaded successfully (it relies on the browser cache). If you clear the cache or switch devices, you need to go online to load it again.
No. Favorites and recent-use records only store tool names, never your files or text. When you are not signed in, favorites are kept only in your browser's localStorage; after signing in they sync to your account and work across devices. Recent-use records stay on your own machine.
First check that the input is complete and the format matches the hints on the page — you can click the example on the page to verify quickly. If it is still wrong, refresh the page and send us the steps and a screenshot via the feedback form.
Send your question or suggestion via 「Feedback」 in the top bar. Describe the use case and the outcome you want, and we will assess it before updating the tool and the page.