Formatting
URL encoder uses encodeURIComponent, the function you want for a single parameter value. a b/c?d=e&f becomes a%20b%2Fc%3Fd%3De%26f. Space is %20, slash is %2F, question mark is %3F, equals is %3D, ampersand is %26. If those characters were left raw, they would split the query into extra parameters.
encodeURI is the other standard function, and this page does not call it. encodeURI would encode the space and leave / ? & = in place, which is right for a whole URL and wrong for one value. The query builder is a third spelling: it writes spaces as +, because it uses form encoding. Pick the page that matches the consumer. Direction starts on encode. Decode runs decodeURIComponent, which turns %20 back into a space and does not treat + as a space.
Encoding is not encryption. a%20b%2Fc is trivial to reverse on the decoder page. There is no key.
Direction encode. a b/c?d=e&f
a%20b%2Fc%3Fd%3De%26f
The slash and the ampersand are the reason to use this page. A function that leaves them raw is encoding a URL, not a component.
encodeURI is for a whole URL. It encodes spaces and leaves characters that structure the URL, including / ? & =. encodeURIComponent is for one piece. It encodes those characters too. This page runs encodeURIComponent, so a b/c?d=e&f becomes a%20b%2Fc%3Fd%3De%26f. encodeURI would have kept the slash, the question mark, the equals sign and the ampersand.
encodeURIComponent writes %20. The query-string builder uses URLSearchParams and writes +. Decoders do not agree about +, so match the encoder to the parser.
No. Percent-encoding is reversible spelling. The decoder turns a%20b%2Fc%3Fd%3De%26f back into a b/c?d=e&f without a key.
Only if you want the :// and the slashes encoded, which you usually do not. Encode the components that are data, and leave the URL’s structure alone.