Base64 Encoder

Encode and decode Base64 strings instantly. Supports text and file input. Free online tool, no upload, runs in your browser.

Preparing private browser tool…

Your file will stay on this device.

Frequently asked questions

What is Base64 used for?
Encoding binary data (images, files) as ASCII text so it can be safely embedded in URLs, JSON, emails, HTML, or CSS data URIs.
Is Base64 encryption?
No. Base64 is encoding, not encryption. Anyone can decode it trivially. Do not use Base64 to hide secrets.
Why is Base64 output larger than input?
Base64 uses 4 characters to represent every 3 bytes of input, making the output about 33% larger.
Can I encode images as data URIs?
Yes. The tool accepts file uploads and outputs `data:image/...;base64,...` that you can paste directly into HTML or CSS.
What are the URL-safe and line break options for?
URL-safe swaps + and / for - and _ and drops the padding so the string can sit in a URL or a JWT. The line break option wraps the output at 76 characters, which is what MIME email expects.
Why does decoding fail on my string?
Decoding rejects input that is not valid Base64, most often because a character was lost in a copy or the padding at the end is missing. Whitespace and line breaks are stripped automatically, so those are not the cause.