Base64 Image Encoder
v1.0Base64 Image Encoder converts between image files and Base64 data URIs, entirely in your browser. Nothing is uploaded.
To encode, drop an image in or load one from the Sample menu: a small Mondrian PNG (no warning), The Starry Night as a JPEG (over the 50KB warning), or an Earth cutout with transparency. You get four ready-to-use views, each with its own copy and download buttons: the raw base64 payload, the full data:image/…;base64,… URI, a background-image CSS declaration, and a minimal <img> tag. A summary shows the original size, the pixel dimensions, the character counts and the type. Loading a second image swaps the output in place instead of blanking it first.
Base64 makes the data about a third bigger, and a data URI can't be cached apart from the page that embeds it. Past 50KB of encoded output the tool says so and suggests hosting the image as a normal file. Small icons stay warning-free.
To decode, switch to Base64 → Image and paste a full data URI or a bare base64 payload. A Sample menu offers a PNG data URI, a bare PNG payload, an SVG data URI and a deliberately invalid one. A valid paste decodes at once into a preview with the detected type and exact byte size, and Download as file saves the decoded bytes with the right extension. Bare base64 has no type, so the tool works it out from the first bytes (PNG, JPEG, GIF or WebP). If nothing matches, it says so and asks for a data: prefix.
Errors wait for a pause in typing, about half a second, so a half-pasted payload does not flash a red box, and the last good preview stays on screen until then. Only the direction and the output tab are remembered between visits. Images and pasted text are never stored or shared.