Direction
Runs entirely in your browser, nothing is uploaded.
How it works
Image to Base64: Encode a Data URI or Decode One Back
Encode an image as a base64 data URI with copy-ready CSS and img snippets, or paste one back to recover the file. The exact size increase is printed.
What this does
- Four copy fields, the raw payload, the full data URI, a quoted CSS url() rule and an img tag
- Width and height filled into that img tag from the decoded image, so the layout does not shift on load
- Decoding repairs line breaks and missing padding, and swaps the URL-safe - and _ back
- Identifies PNG, JPEG, GIF, WebP, AVIF, BMP, ICO, TIFF and SVG from their signature bytes when the header is missing or wrong
- The source size, the data URI size and the percentage between them, side by side
FAQ
Keep going