URL encoding example: spaces and an apostrophe
Why a query value needs percent-encoding, and why encoding the entire URL is a different operation.
Open URL Encode / Decode to run this case yourself.
Query value
red shoes
rawurlencode of that value
red%20shoes
The problem
A search URL has to carry a space and an apostrophe: https://api.example.com/search?q=red shoes&category=men's&page=2. Spaces and reserved characters are not safe to leave raw inside a query component. A space can be treated as the end of the URL by a client. An apostrophe can break a surrounding string if someone interpolates the URL into code or HTML without encoding.
What encoding is for
Percent-encoding replaces a byte with % and two hex digits. CompareStack’s encode action is PHP rawurlencode. A space becomes %20, not +. An apostrophe becomes %27. Encoding only the values is the usual fix: q=red%20shoes and category=men%27s, with the scheme, slashes, ?, and & left as separators.
If you paste the entire URL into this tool, rawurlencode encodes those separators too. The same address becomes https%3A%2F%2Fapi.example.com%2Fsearch%3Fq%3Dred%20shoes%26category%3Dmen%27s%26page%3D2. That string is correct as an encoded blob and wrong as a URL you expect a browser to open. Decode uses rawurldecode on the whole paste. The tool does not split a URL into parameters for you.
When this tool may not be the right choice
- You need a query-string parser that encodes each parameter and leaves the URL structure intact. Encode the value, then place it back into the URL.
- application/x-www-form-urlencoded, where a space is often +. rawurlencode will not produce that plus sign.
- HTML escaping or SQL escaping. Percent-encoding is not a substitute for either.
Processing and privacy
Paste tools also run on the server. The text is sent in the form POST, with a limit of 100,000 characters per field. It is not written into a document library or a user account. Server logs can still record technical request metadata such as IP address and URL. Do not paste secrets, credentials, or personal data you are not allowed to send to a web service.
The Privacy Policy and how processing works are the full description.