Features
- Four formatsData URL, plain Base64, img tag or CSS background.
- Size shownCompare the file size with the text length.
- Runs on your deviceYour data is processed in the browser and is never uploaded.
How to use the Image to Base64
- Choose or drop an image.
- Pick an output format.
- Copy it.
When to embed
Embedding saves a request for tiny icons, but Base64 is about a third larger and cannot be cached separately.
Make a data URL in JavaScript
const reader = new FileReader();
reader.onload = () => console.log(reader.result); // data:image/png;base64,…
reader.readAsDataURL(file);
Frequently asked questions
What is the size limit?
5 MB.
Is image quality changed?
No. The bytes are encoded as they are.
Does it work with SVG?
Yes.