Base64 / URL Encoder

Four actions share one input box: Base64 encode / decode and URL encode / decode. Everything is handled as UTF-8 — Chinese and emoji come back intact, and that is exactly where most online tools go wrong.

Output

—

—

Base64 is not encryption

It only rewrites bytes another way. Anyone can reverse it and there is no key. So a string like 5L2g5aW9 is not a secret — paste it here and press decode. If you need to protect something, use real encryption; Base64 protects nothing.

Why so many tools mangle Chinese

The browser’s built-in btoa() only accepts Latin-1 and throws on Chinese characters; plenty of implementations work around that by splitting the string into UTF-16 bytes — and the result comes back as mojibake. The correct order is text → UTF-8 bytes → Base64, and the reverse when decoding. That is the path this page takes.

URL encoding escapes components, not whole URLs

This page uses encodeURIComponent, which escapes : / ? & = as well — exactly what you want when encoding a parameter value. To encode a complete URL, use encodeURI, which leaves reserved characters alone. Mixing the two up is the most common way links break, so this page states one rule only.

Questions

Why do I get an error instead of a string of question marks?

Because that Base64 does not contain text. Images, archives and encrypted bytes all decode to something that is not valid UTF-8. Many tools replace the bad bytes with � and carry on, which looks like "it worked, just a bit odd". This page says what actually happened: it decoded, and what came out is not text.

How much longer does Base64 make my data?

About 4/3 — one third longer. Every 3 bytes become 4 characters, padded with = at the end. That is why Base64 is for "put bytes somewhere that only accepts text", not for compression.

What is the difference between %20 and + in URL encoding?

%20 is the standard percent-encoding of a space. + meaning space comes from application/x-www-form-urlencoded (HTML form submission). This page emits %20, which is correct anywhere in a URL; + only means space in certain query-string parsers.

Is there a size limit?

No hard limit, but long inputs will visibly stall: encoding runs on the main thread in one go, so a few megabytes causes a pause after you press the button. Links, configs and keys are a few KB and you will not notice.

Mouse repair

QR codeWeChat
淘宝店铺二维码淘宝店铺

Mouse acting up? Get in touch.

Repair