URL Encoder and Decoder

Percent encoding, with the right scope.

Direction
Scope

Percent encoding, with the right scope.

How to use it

  1. Paste the value. A single query value, or a complete URL.
  2. Set the scope. One value escapes the separators. Whole URL leaves them working.
  3. Copy the result. A broken escape is named rather than throwing an error at you.

When you would use this

Percent encoding has one decision in it and it is the one that gets made wrong. Encoding a single value and encoding a whole URL are different operations. Inside a value, an ampersand is data and has to become %26 or it splits the query string in two. In a whole URL, that same ampersand is the separator and escaping it breaks the address. JavaScript has two functions for this and the difference between them is exactly this, and choosing the wrong one produces a URL that looks fine and behaves incorrectly. So scope is a control here rather than an assumption, and the default is the one people need more often: a single value. Decoding reports a broken escape by explaining it rather than throwing. A stray percent sign, which is common in text copied from a document, otherwise produces an unhandled error that says nothing useful about what to fix.

Questions

What is the difference between the two scopes?
One value escapes the characters that are structural in a URL, including ampersand, equals and slash, because inside a value those are data. Whole URL leaves them alone so the URL still works. Using the wrong one either breaks your query string or leaves a value that splits it in two, and both fail silently.
Why does a space become %20 rather than a plus?
Because plus only means space in the application/x-www-form-urlencoded content type, which is form submission, not URLs generally. Percent twenty is correct everywhere. If you specifically need form encoding, replace the escapes yourself after.
Is anything I paste sent anywhere?
No. It runs in the page, which is the reason to use this one rather than the first result on a search. People paste production values into these boxes constantly, and every other version receives a copy.