Encode or decode a URL component or a query string. The other side updates as you type, and nothing is sent to a server.
1
1
Percent-encoding writes a byte as a percent sign and two hex digits. Component mode runs encodeURIComponent on the whole text: it escapes everything except letters, digits and - _ . ! ~ * ' ( ).
Query mode keeps a leading question mark, and the separators & and =. Each key and each value is encoded on its own. Space as + rewrites %20 to +, which is what application/x-www-form-urlencoded does.
a b
a%20b
?q=a b&x=1
?q=a+b&x=1
a+b decoded with Space as + → a b
a+b decoded with Space as + off → a+b
A percent sign that is not followed by two hex digits makes decodeURIComponent throw. The previous result stays on screen.
Encoding a value that is already encoded escapes the percent signs, so %20 becomes %2520. Decode once, then encode if you still need to.
This page does not call encodeURI. That function leaves ; / ? : @ & = + $ , # untouched, which is a different job from encoding one component.
Each side is limited to 100,000 characters. The share link stores the source side, the mode and the space switch. The other side is computed again when the link is opened.
RFC 3986, “Uniform Resource Identifier (URI): Generic Syntax”, was published in January 2005. Percent-encoding is how a URI keeps a reserved character as data instead of as syntax.
The HTML form encoding application/x-www-form-urlencoded writes a space as +. A literal plus has to be percent-encoded as %2B, otherwise a decoder that follows the form rules reads it as a space.