Base64 Image Encoder
Turn any image into a base64 data URI you can paste into HTML, CSS, or JSON. Everything runs in your browser — your image is never uploaded.
| Original file size | - |
|---|---|
| Base64 data URI size | - |
| Size increase | - |
Base64 turns every 3 bytes into 4 text characters, so encoded output is always about 33 percent larger than the original file.
How to use
- Pick an image file (up to 5 MB) with the file picker above.
- See the preview and compare the original size with the base64 size.
- Copy the data URI to your clipboard, or download it as a text file.
- Paste the data URI anywhere a normal image URL works, for example in an
<img src="...">tag.
The file is read locally with JavaScript. Nothing is uploaded or stored anywhere.
Frequently Asked Questions (FAQ)
What is the Base64 Image Encoder?
It is a free tool that converts an image file into a base64 data URI, a long text string you can paste directly into HTML, CSS, or JSON without hosting the image as a separate file.
Why is the base64 output larger than the original image?
Base64 encoding turns every 3 bytes of binary data into 4 text characters, so the output is about 33 percent larger than the original file. The tool shows both sizes so you can see the difference.
Is there a file size limit?
Yes. Files up to 5 MB are accepted. Larger files are rejected with a message so the page stays fast and your browser does not slow down.
Does my image leave my browser?
No. The file is read locally with JavaScript and never uploaded to any server. Everything stays on your device.