Base64 File Encoder & Decoder — Any File Type
Encode any file to a Base64 string, or paste a Base64 blob to decode it back to a file. Useful for embedding images in HTML/CSS as data URIs, storing binary data in JSON, or debugging APIs that return Base64-encoded payloads.
Common use cases
Inline an icon in an HTML email as a data: URI, embed a small image in CSS to reduce HTTP requests, or decode a Base64 attachment from an API response back to its original binary form.
Files stay local
Encoding runs in your browser — sensitive files (certificates, PDFs, private images) never touch a server.
Encode any file to Base64 online
Drop any file, such as an image, a PDF, a font or a certificate, and the tool converts it to a Base64 text string you can copy or download. Paste a Base64 string back in to decode it to the original file. Both directions run in your browser.
Data URI or plain Base64
To embed a file in HTML or CSS you usually need a data URI: the Base64 string prefixed with the file type, for example data:image/png;base64, followed by the encoded text. JSON payloads, environment variables and API requests normally use the plain string without that prefix.
Frequently Asked Questions
How big can the input be?
Browser memory limits apply. Files under 10 MB encode instantly; hundreds of MB may stall the tab.
Is Base64 encryption?
No — it's just a text encoding. Anyone can decode it. For secrecy, encrypt first.
Why does Base64 make the file bigger?
Base64 uses 4 characters to represent 3 bytes, so encoded output is ~33% larger than the source.
Is Base64 encoding lossless?
Yes. Decoding the string gives back the original file byte for byte.
Which file types can I encode?
Any type. Base64 works on raw bytes, so images, PDFs, ZIP archives, audio and executables all encode the same way.
Why does my decoded file not open?
The string was usually cut off while copying. If it starts with a data: prefix and the decoder rejects it, remove everything up to and including the comma and try again.