Base64 file converter
What is a Base64 File Converter?
Base64 lets you represent any file, such as an image, PDF or font, as plain text. That is useful when a file must travel through a text-only channel: an HTML attribute, a CSS rule, a JSON API payload, an email or an environment variable. This converter turns a file into Base64 or a complete data URI, and turns Base64 back into a file you can download.
How to use it
- Choose a file or drop it onto the tool. Images show a preview.
- Copy the plain Base64 string or the full data URI, for example
data:image/png;base64,iVBORw0KGgo.... - To decode, paste a Base64 string and download the resulting file.
Using data URIs
- HTML:
<img src='data:image/png;base64,...'> - CSS:
background-image: url(data:image/svg+xml;base64,...) - JSON: send the Base64 string in a field and decode it on the server.
When not to use Base64
Base64 makes files about 33% larger, because every 3 bytes become 4 characters. Inline data also cannot be cached separately by the browser. Data URIs make sense for tiny icons and placeholders, often under a few kilobytes. For anything bigger, a normal file URL loads faster and caches better.
Privacy
Files are read with the browser's FileReader API and never uploaded. This makes the tool safe for documents you would not want to send to an online service.
Frequently Asked Questions
How do I convert an image to Base64?
Select the image file. The tool reads it in your browser and shows both the Base64 string and a ready-to-use data URI.
Why is the Base64 output bigger than my file?
Base64 represents every 3 bytes with 4 characters, so the output is about 33 percent larger than the original.
Can I turn Base64 back into a file?
Yes. Paste the Base64 string or data URI and download the decoded file.
Are my files uploaded?
No. The conversion happens entirely in your browser using the FileReader API.