Base64 Image Encoder/Decoder
100% PrivateImage ToolsTurn an image into a Base64 data URL for HTML or CSS, or decode one back to an image.
Runs entirely in your browser. Your input is not uploaded to Ovatly or anywhere else.
- 1For encoding: choose an image and the complete data URL appears, with the original size and the exact character count.
- 2Copy the data URL, or download it as a text file.
- 3For decoding: switch direction, paste a data URL that starts with data:image/ and click Decode to image.
- 4Preview the decoded image and download it as a real file.
Base64 always expands data by a factor of 4/3: a 30,000 byte JPEG becomes about 40,000 base64 characters, plus a short prefix like data:image/jpeg;base64,. The tool computes the decoded byte length from the payload itself, so you can verify: the payload QUJD is exactly 3 bytes, the letters ABC.
- Only base64 data URLs for images are decoded; plain base64 without the data: prefix, and non-image types, are rejected with an explanation.
- Data URLs are convenient for very small images. Anything beyond a few kilobytes usually belongs in a real file, because the encoded text cannot be cached separately.
- A data URL decoded here is rebuilt byte by byte on your device; a single missing character in the paste changes or breaks the result.
Base64 encodes 3 bytes into 4 characters, so text form is always about one third larger, before the data:image prefix. That overhead is the price of embedding binary data in text.
About this tool
The Base64 Image Encoder and Decoder turns an image into a data URL you can paste into HTML, CSS or JSON, and turns such a data URL back into a downloadable image file. Developers use data URLs for tiny inline icons and email-safe assets; this tool shows you the exact size cost of doing it.
Related tools
Part of Ovatly's free tools in Image Tools.