URL encoding explained (percent-encoding)
URL encoding turns special characters into %XX sequences so URLs remain valid and unambiguous.
When you need URL encoding
URL encoding is needed when text contains characters that have special meaning in URLs: spaces,
&, =, ?, #, and many others. If you put raw text
into a query parameter, you can break parsing or change the meaning of the URL.
Encode vs decode (the mental model)
- Encode: turn raw text into a safe URL representation (e.g. space →
%20). - Decode: turn
%XXsequences back into the original text.
Plus vs %20
In many query string forms, a space is represented as +. In strict URL encoding,
spaces are %20. This mismatch is a common source of confusion:
- If you see
+in query strings, treat it as space (common form encoding). - If you need a literal plus, it should be
%2B.
Safe no-upload workflow
- Decode locally when debugging UTM parameters, callback URLs, or encoded payloads.
- Inspect the decoded text for secrets (tokens, emails, IDs).
- Encode locally when you need to build URLs programmatically (avoid manual mistakes).
FAQ
Should I encode the whole URL? Usually you encode individual parameter values, not the entire URL.
Is it safe to decode here? Yes. All processing happens locally in your browser. Files are never uploaded.
Local verification snippet
Run a quick local check before export/convert:
const text = input.trim();
const value = JSON.parse(text);
console.log(Array.isArray(value) ? 'array' : typeof value);
Related by intent
Closest pages and hubs to accelerate crawl discovery and first impressions.