Scenario
The search link works for q=shoes and falls apart for red shoes & socks. The reason is structural: & separates parameters in a query string, so the raw value splits the URL into q=red shoes plus a phantom parameter named socks. The server sees a truncated query and the user sees wrong results. Any character with URL syntax meaning — &, =, ?, #, spaces — must be percent-encoded when it appears inside a value.
Broken input
q=red shoes & socks
Goal
Use URL Encoder to encode the parameter value — and only the value — so the special characters travel as data instead of being parsed as URL structure.
Tool sequence
- Open URL Encoder.
- Encode just the value
red shoes & socks, not the wholeq=...pair — encoding the=would break the parameter syntax you need to keep. - Read the output: spaces become
%20and the ampersand becomes%26. - Rebuild the URL as
?q=red%20shoes%20%26%20socksand confirm the boundary characters that remain (?,=) are the structural ones you meant to keep. - Verify the round trip by pasting the rebuilt URL into URL Parser / Inspector — the parsed
qshould decode back to exactlyred shoes & socks.
Checkpoint output
raw value: red shoes & socks
encoded: red%20shoes%20%26%20socks
final URL: https://example.test/search?q=red%20shoes%20%26%20socks
The & now travels inside the value as %26; the server receives one q parameter containing the full phrase.
Common mistakes
- Encoding the entire URL, which turns the structural
?and=into%3Fand%3Dand breaks the request a different way. - Leaving
&unescaped inside a value, silently creating a parameter namedsocksthat no handler reads. - Double-encoding an already-encoded value, turning
%20into%2520— a literal "%20" in the search text. - Fixing the one link by hand instead of the URL-building code, so the next special-character query breaks the same way.
Related tools and lessons
- URL Parser / Inspector - Inspect normalized URL parts and decoded query parameters.
- Query String Parser / JSON Converter - Convert query strings and flat JSON objects both ways.
- Base64 Encoder - Encode or decode Base64 strings.
- Related lesson: Inspect a URL Before Debugging a Routing Bug
- Related lesson: Inspect Query Params From a Failing URL