Convert an image to Base64 and back
Data URIs for inline assets, decoded files when you need them.
Files never leave your device · free · no signup
Drop images here
or browse, or paste with ⌘V
Files never leave your device
How it works
- 1
Choose a direction
Encode a file, or paste a data URI to decode it.
- 2
Copy or download
Encoding gives you a `<img src>` ready string; decoding gives you the original bytes.
- 3
Mind the size
Base64 is about 33% larger than the binary file, so keep inline images under a few KB.
What this tool does
- File → data URI with the correct MIME type and byte count
- Data URI or raw base64 → downloadable image
- Copy the whole string or just the base64 payload
- Warns when a data URI is too large to be practical inline
Frequently asked questions
Is base64 the same as encryption?
No. Base64 is an encoding, not protection — anyone can decode it. Use it to inline data, never to hide it.
Why does my data URI break CSS?
Long strings are fine, but quotes and newlines are not. Use the single-line output and wrap the URI in quotes: `background-image:url("data:image/png;base64,...")`.
Does this work with SVG?
Yes. SVG source files are uploaded as `image/svg+xml` and the tool returns the proper data URI. Note that SVG in a data URI must be URL-encoded or base64-encoded to be safe.
Related tools
Privacy note
Everything happens in your browser: the file is read, edited and saved on your device, with no upload.