Image to Base64

Convert any image to Base64 string for embedding in CSS or HTML. 100% local.

Drop an image here
or click to browse, or paste with Ctrl+V / ⌘V
Preview
Base64 encoding increases the file size by approximately 33% because every 3 bytes of binary data become 4 ASCII characters. This overhead is an inherent property of Base64; keep it in mind when inlining large images.
Output format
Paste Base64 or Data URL
Decoded image
Decoded image

How it works?

Your image is read entirely in the browser using the FileReader API with readAsDataURL(), which converts the raw binary file into a Base64-encoded Data URL. No data ever leaves your device. The tool then strips or formats the result depending on the output mode you choose. For the reverse direction, it validates the input string, constructs a proper Data URL if needed, and renders it directly into an <img> element. The ~33% size overhead comes from the Base64 alphabet: every 3 bytes (24 bits) of source data are split into 4 groups of 6 bits, each mapped to a printable ASCII character, resulting in a 4/3 expansion ratio.