Image to Base64 Converter
Convert an image to a base64 data URI, or decode one back to an image.
By opening this website or using its tools, you agree to our Terms and Privacy Policy.
or drag it here
PNG, JPG, WEBP, HEIC, or any image
Your file never leaves your browser during processing
How it works
To convert an image to base64, drop it onto the Image → Base64 tab above — the exact file bytes are read and encoded as a data URI and a plain base64 string, both copyable, with nothing uploaded; the Base64 → Image tab reverses the process for a pasted data URI or raw base64 string.
Base64 encodes arbitrary binary data as plain text using 64 printable characters, which is what lets an image be embedded directly inside CSS, HTML, or JSON instead of being loaded as a separate file — useful for a small icon you want inlined to avoid an extra network request, or for pasting image bytes into a context that only accepts text, like an API payload.
Image → Base64 reads the uploaded file with the browser’s FileReader API directly into a data URI, so the bytes are identical to the original file — there is no canvas re-encoding step that could recompress or alter the image, unlike this site’s compress or resize tools.
Base64 → Image reverses this: it decodes the pasted base64 payload back into raw bytes and reconstructs a downloadable image. If you paste a full data URI (starting with "data:"), the image type is read from it automatically; if you paste raw base64 with no prefix, choose the image type from the dropdown so the bytes can be interpreted correctly.
FAQ
Does converting to base64 change the image quality?
No. The file is read as raw bytes and encoded as text — there is no re-compression or re-encoding step, so the decoded image is byte-for-byte identical to what you uploaded.
Why is the base64 string so much longer than the original file size?
Base64 encoding trades compactness for being plain text: it expands binary data by roughly a third, since every 3 bytes of the original file become 4 base64 characters.
What if my base64 string doesn’t start with "data:"?
That’s a raw base64 payload with no embedded type information. Paste it into the Base64 → Image tab and choose the correct image type from the dropdown that appears.