How to use it
- To encode: choose an image and copy the data URL, an <img> tag or a CSS rule.
- To decode: paste a data URL or raw Base64 and download the image.
How it works
A data URL is the text “data:” followed by the file type and the file’s bytes in Base64. Base64 turns every 3 bytes into 4 characters, so the text is about 33% larger than the file. Decoding checks the first bytes of the data to identify PNG, JPEG, GIF or WebP, and then loads it as an image.
Examples
- A 2 KB icon becomes about 2.7 KB of text that can sit directly inside a stylesheet.
Limitations
- Data URLs suit only small images: large ones bloat the page and cannot be cached separately. Images over 3 MB are refused.
- SVG images are not decoded here for safety, because SVG can contain scripts.
- Base64 is an encoding, not encryption.
Last verified . See our Accuracy & Editorial Policy. Found a problem? Email contact@tools.gift.