Base64 Image Encoder Decoder
Encode image bytes as Base64 or inspect pasted image data URLs without uploading the source.
Choose What You Want to Do
Choose a PNG, JPG, WebP, GIF, SVG, or other image file. The image is read in your browser and is not uploaded.
Output Options
Output
Base64 image output will appear here.
What changes when an image becomes Base64
Base64 represents binary bytes with printable ASCII characters. It does not compress the image, improve quality, or change the pixel data. A Base64 payload is normally about one third larger than the original bytes before the data-URL prefix is added.
A data URL adds a media type such as image/png and the ;base64 marker. That media type is metadata supplied by the source, so the decoder also checks common raster signatures instead of trusting a PNG, JPEG, GIF, WebP, or BMP label blindly.
Small inline assets versus normal image files
Inlining can make sense for a tiny icon, fixture, email snippet, or reproducible bug example. For ordinary site images, separate files are usually easier to cache, inspect, replace, and serve efficiently. A 400 KB image does not become cheaper because it is embedded in CSS or HTML.
MIME labels, SVG, and trust boundaries
A pasted data URL can claim any media type. Raster signatures provide a useful sanity check, but they are not malware scanning. SVG is XML-based text and may contain links, external references, or active constructs depending on where it is later embedded. Review untrusted SVG before placing it into HTML or CSS.
The preview proves only that the browser can decode the supplied bytes as an image. It does not prove that the content is safe for every downstream context.
Base64 rules used here
The alphabet and padding rules follow RFC 4648 Base64. Pasted values may omit final padding when the remaining length can still represent complete bytes; impossible one-character remainders and malformed padding are rejected. Whitespace between Base64 characters is removed for pasted input.
Reference: RFC 4648 — Base-N Encodings.
A quick size check before copying
Compare the decoded byte estimate with the Base64 character count shown above. If the result is going into source control, an API payload, or a support ticket, check whether a normal file attachment or object URL would carry the intent more clearly.
