MewTools

EncodingTool 05

Image to Base64

Inline a small image directly in your CSS or HTML. The file is encoded in the browser and the data URI is ready to paste.

Runs locallyNo uploadPNG, JPG, WebP or GIFFree, no account

Encode image

10 / 232
Image
PNG, JPG, WebP or GIF · keep inlined files small
Output

Result

Waiting

Run the tool and the result appears here. Copy it or download it — nothing leaves this tab.

Privacy

Local by design

Your file is read with the browser's File API and processed in this tab. Nothing is uploaded, and no copy is kept on a server.

How to use it

01

Drop the image you want to inline. Its MIME type is detected automatically.

02

Choose a full data URI for CSS or an img src, or raw Base64 for a JSON field.

03

Copy the string, or download it as a text file for later.

When to use it

Inline icons

Embed a tiny icon in CSS to avoid one extra request.

Email templates

Use a data URI where external images may be blocked.

Test fixtures

Put a small image into a JSON fixture without a file dependency.

Questions

Is Base64 larger than the original?

Yes, roughly a third larger. Inline only small images; large photos are better served as separate files.

Which MIME type is used?

It comes from the file the browser reports, such as image/png or image/jpeg.

Can I decode it back?

Yes. Paste the data URI into the Base64 to Image tool to rebuild the picture.

Should I use a data URI or the raw Base64 string?

Use the data URI when the image goes straight into CSS, an img src or an HTML email. Use raw Base64 when a JSON field or an upload API expects only the encoded payload with the MIME type sent separately.

How large an image is reasonable to inline?

Base64 adds roughly a third to the byte size, so keep inlined icons and logos under about 10 KB. Larger images block the HTML parser and are better served as normal files.

↑↓ to move↵ to openEsc to close