Common questions about percent-encoding, spaces and double encoding.
Should a space be encoded as %20 or +?
In URL paths, a space is always %20. In query strings sent by HTML forms (application/x-www-form-urlencoded), a space can also appear as +. encodeURIComponent always produces %20, which works everywhere.
What is double encoding?
Encoding a string that is already encoded: %20 turns into %2520, because the % sign itself gets encoded. It usually happens when two layers of code both encode the same value. Decode the string once to see whether that's what happened.
Which characters need to be encoded?
Inside a URL component, everything except letters, digits and - . _ ~ should be encoded. Reserved characters such as & = ? / # need encoding when they are part of a value. Non-ASCII characters are encoded as their UTF-8 bytes, so é becomes %C3%A9.
Is my input sent to a server?
No. Encoding and decoding run in your browser, so what you paste never leaves your device.