Query-value boundary lab · Updated November 18, 2026
Encode a Semicolon in a URL Query Value
A semicolon inside a query value is data unless the receiving application defines it as a separator. Encode it as %3B when the value must survive parsing unchanged.
Same characters, different contracts
| Wire form | Decoded value | Risk |
|---|---|---|
note=a;b | a;b | An application may split on semicolon. |
note=a%3Bb | a;b | The delimiter is explicit data after decoding. |
note=a%3Bb&mode=full | a;b plus a separate key | & separates these query pairs. |
Measured output
Run date: November 18, 2026. Node.js v24.19.0: encodeURIComponent("a;b") = a%3Bb. PHP 8.5.12: rawurlencode("a;b") = a%3Bb. Both preserve the semicolon as data when encoded.
Input: role=admin;scope=read | URLSearchParams wire value: role%3Dadmin%3Bscope%3Dread | Decoded value: role=admin;scope=read
Download the reproducible fixture CSV
Common failure
Do not claim every framework treats semicolons as separators. Test the actual server parser and keep the delimiter policy in the API contract.
FAQ
Is semicolon always unsafe in a query?
No. Its meaning depends on parser and application policy. Percent-encoding removes ambiguity on the wire.
Does encoding a semicolon encrypt it?
No. It only represents one character safely; anyone can decode it.
For repeated keys and empty values, see Query Parameters. For general component encoding, use the URL Encode tool.