Skip to content

Base64 File & Image Encoder / Decoder

— a file as a string.

30 / 36 Local

View

Turn a file or an image into a Base64 string or a Data URL, and back again. Ready-made HTML and CSS snippets copy in one click, all in your browser.

Convert images and files to Base64 and Data URLs, or decode Base64 strings back to downloadable files right in your browser.

Also searched as: image to base64 · photo to base64 · picture to base64 · image into base64 · photo into base64 · picture into base64

Free · Local · works offline · FILE ↔ BASE64 · DATA URL

Frequently asked questions

Why is my Base64 string bigger than the original file?
Base64 encodes three bytes as four characters, so everything grows by about 33%. That is inherent to the encoding, not a fault — it is the price of moving binary data through a text-only channel.
When should I inline an image as a data URL?
For small assets — icons and tiny backgrounds under a few kilobytes — where saving a network request outweighs the size penalty. Inlining a large photo makes the stylesheet or HTML that carries it slower to parse and impossible to cache separately.
Is Base64 a form of encryption?
No, and treating it as one is a real security mistake. It is a reversible encoding with no key — anyone can decode it in one step. Never use it to hide a password or a token.
Why does my decoded file come out corrupted?
Almost always because the string was truncated or carries a prefix. A data URL starts with `data:image/png;base64,` and only the part after the comma is the payload; copying from a terminal that wrapped the text can also drop characters.

Guides for this tool