How to convert an image to Base64
- Drop an image or click Choose file.
- Choose the output: data URI, plain Base64, a CSS
background-image, an HTML<img>tag or Markdown. - Click Copy or download the code as a text file.
When to inline images as Base64
- Small icons and logos in CSS or HTML emails, to save an extra request.
- Embedding images in JSON, configuration files or single-file HTML pages.
- Avoid it for large photos: Base64 is about 33% bigger than the file and cannot be cached separately.
Decoding Base64
Paste a data URI, plain Base64 or even a whole CSS or HTML snippet into the second tab. The tool detects PNG, JPEG, GIF, WebP, BMP or SVG from the bytes, shows a preview and lets you download the file.
Frequently asked questions
Is it free and private?
Yes. It is free, needs no sign-up and runs entirely in your browser, so your files are never uploaded.
Why is the Base64 text bigger than the image?
Base64 uses 4 characters for every 3 bytes, so it is roughly 33% larger.
Is my image uploaded?
No. The file is read with your browser’s FileReader and never leaves your device.
Does it work on a phone?
Yes, in any modern mobile browser. The result is saved to your downloads folder.