URL Encoding: Reserved Characters, Plus for Space and Whole-String Traps

Open Tool URL Encoder & Decoder

Why encoding is mandatory

URLs reserve characters for structure: ? starts the query, & separates parameters, = joins key and value, # marks a fragment, / separates path segments, and a raw space was once outright illegal. If a parameter value contains these, the browser or server reads structure instead of data, so the value gets truncated, shifted, or rejected with a 400. Percent encoding turns them into %XX: a space becomes %20 and Chinese text becomes one %XX per UTF-8 byte, so 中 is %E4%B8%AD. This is what RFC 3986 defines.

Steps

  1. Paste the URL or text into the input box.
  2. With space as plus enabled, a space becomes +, the application/x-www-form-urlencoded convention used by HTML forms; leave it off for %20.
  3. Click Encode. Load example shows a demo and Clear resets.
  4. To decode, paste a string containing %XX and run again; the tool also restores plus signs to spaces.

The whole-string trap

Encoding an entire URL such as https://example.com/a?b=c yields https%3A%2F%2Fexample.com%2Fa%3Fb%3Dc, with colon, slashes and question mark all escaped. The browser no longer treats it as a URL and you land on a 404 or a search page. Encode only the parameter value: scheme, host, path separators, question mark and equals stay literal. The reverse mistake matters too: if a server already returns an encoded value, encoding it again double-escapes %20 into %2520.

Diagnosing failures

If parameters go missing, look for a raw ampersand inside a value. If Chinese arrives garbled, confirm the encoder used UTF-8 rather than GBK — legacy GBK parameters are common — then transcode and re-encode. If plus signs turn into spaces, the receiver applied form rules while your value legitimately contained a plus, so encode it as %2B. Chinese in a path is best encoded as well; browsers cope, but a link truncated by a chat app often fails.

⏫︎