What does URL encoding actually do at the byte level?
URL encoding takes each character outside the unreserved set (A-Z, a-z, 0-9, hyphen, underscore, period, tilde), converts it to its UTF-8 byte sequence, and replaces every byte with a percent sign followed by two uppercase hexadecimal digits. A single ASCII character maps to one %XX, and a Unicode character like the euro sign € maps to three: %E2%82%AC.
Why does this tool use encodeURIComponent and not encodeURI?
encodeURIComponent encodes a single URL component value — what you would put after q= in a query string. encodeURI is for full URLs and intentionally leaves /, ?, &, # unencoded so the URL stays parseable. If you paste a value that should become safe inside a parameter, encodeURIComponent is the right call. Encoding a whole URL with encodeURIComponent breaks its structure.
Is %20 different from + when encoding a space?
%20 is the RFC 3986 percent-encoding for a space and works in any URL context. The + character represents a space only inside application/x-www-form-urlencoded form bodies and the query component on some servers. This tool emits %20 to stay portable. Servers that accept form-encoded query strings will decode either, but reverse-proxy code paths that use the URL standard expect %20.
How do I avoid double encoding?
Double encoding happens when you re-encode a value that already contains %XX sequences — every percent sign itself becomes %25, so %20 turns into %2520. Always decode first if you are unsure. A safe rule: encode raw user input once on the way into the URL, never again. If you receive a value from a router that already decoded it, you encode that decoded form once.
Which characters are never encoded?
The unreserved set: uppercase A-Z, lowercase a-z, digits 0-9, hyphen (-), underscore (_), period (.), and tilde (~). These 66 characters survive encoding unchanged because they are guaranteed safe inside any URL component.
Does this tool send my input to a server?
No. Encoding happens in JavaScript inside your browser — open DevTools, switch to the Network tab, and click Run. No request leaves the page. This matters when the value contains tokens, signed URLs, or PII.
How are emoji and non-Latin scripts handled?
Each character is converted to its UTF-8 byte sequence, then each byte is percent-encoded. So 你 becomes %E4%BD%A0 and the rocket emoji becomes %F0%9F%9A%80 (four bytes). The output is always plain ASCII safe for any URL.
Why do I sometimes see + instead of %20 in browser address bars?
Browsers that submit a GET form with method="GET" use application/x-www-form-urlencoded, which converts spaces to + in the query string. The same browser will display %20 if you build the URL via JavaScript with encodeURIComponent. Both decode back to a space, but mixing them in the same URL is a frequent source of subtle bugs — pick one convention.