Base64 Converter

Encode and decode text and files to Base64

Text Charset
Base64 Alphabet
Custom Alphabet (64 chars)
Standard: A-Z, a-z, 0-9, +, / with padding (=)
Input (Plain Text)

Drag and drop your file here

or click to type

Max 5MB

Output (Base64)
Waiting for input...

About This Tool

Encode text or a file to Base64, and decode a Base64 string back to what it was. Type or paste your input, or drop a file onto the box; the output is built instantly and you take it with the Copy or Download button. No install, no sign-up.

Developers reach for it most: a token or API response that arrived Base64-encoded and has to be read, a logo you want to embed in CSS or HTML instead of shipping a separate file, an email attachment, a service whose config expects Base64 values, or debugging a string you spotted in a log and cannot make sense of.

You can switch between encode and decode, pick the standard or URL-safe alphabet, turn padding on or off, choose another charset such as Windows-1256 for legacy text, and watch the input size, output size, and ratio. Files up to 5MB are accepted, and your text and files never leave your device.

Frequently Asked Questions

How do I encode text to Base64?
Pick the Encode mode, put your text in the input box, and the output appears in the box below as you type. Then take it with the Copy button or save it as a file with Download.
How do I decode a Base64 string?
Switch to Decode and paste the string into the input box. If the original data was a file rather than text, the output will look like garbage; use the Download button in that case to save the real file.
How do I convert a file to Base64?
Drag the file from your desktop and drop it onto the input box; the file name shows in the input and the Base64 string in the output. The size ceiling is 5MB, and anything larger returns an error.
It says the Base64 code is invalid. What should I do?
Three common causes: the string was truncated when copied, a stray space or line break landed in the middle, or it was produced with a different alphabet. Paste the string complete and without extra whitespace, and if you see "-" or "_" characters in it, switch the alphabet to URL-safe.
What is the difference between the standard and URL-safe alphabets?
The standard alphabet uses + and /, which mean something else inside a URL. URL-safe swaps them for - and _ so the string can sit in a link or a file name without escaping. If the string goes into a URL, choose URL-safe.
What is padding and when should I turn it off?
Padding is the = signs at the end that round the length up to a multiple of four. Some services and token formats want the string without them, so clear the padding checkbox in that case. Otherwise leave it on.
What is the charset setting for?
It decides how your text is turned into bytes before encoding. UTF-8 is the default and the right answer for almost everything. Reach for UTF-16 or Windows-1256 only when the other side asks for it, or when legacy text comes out garbled under UTF-8.
Does it handle Unicode and non-Latin text?
Yes, with the default UTF-8 charset any Unicode text makes the round trip intact. Picking ASCII will raise an error, because non-Latin letters do not exist in ASCII.
Why is the output bigger than the input?
Every 3 bytes of input become 4 characters, so the output is roughly 33% larger. That ratio is shown next to the output. It is also why embedding a large image as Base64 in CSS inflates your page weight.
Is Base64 encryption?
No. Base64 is encoding only and adds no security whatsoever; anyone can turn the string back into the original data. Use real encryption to protect data, and never treat Base64 as a way to hide a password or token.
What is the custom alphabet for?
For legacy services and formats that use their own character order. You must enter exactly 64 unique characters; otherwise the tool warns you and no conversion runs.
Is any of my data sent anywhere?
No. The conversion runs on your own device, your text and files never leave it, and nothing is stored. Closing the page wipes everything.
Was this tool helpful?
4.6out of 5
Thanks for your feedback!

Related tools

Home