26 chars · 1 line
42 chars · 4 lines
26 chars · 1 line
42 chars · 4 lines
Query string decoding behavior
Query parameters parsed with URLSearchParams use form-style decoding. A raw plus sign represents a space, while the percent-encoded sequence %2B represents an actual plus character. This tool is free to use. No account or payment is required.
Last updated
URLSearchParams follows application/x-www-form-urlencoded conventions for query data. That convention treats + as a space before percent-decoded values are exposed.
A literal plus is therefore represented as %2B. Encoding a space as %20 is also unambiguous when constructing URLs manually.
The parser demonstrates the two meanings side by side.
?q=hello+world&literal=%2B{
"q": "hello world",
"literal": "+"
}Common questions
Query strings commonly use form-style URL encoding, where + is the compact representation of a space.
Percent-encode it as %2B.
This page describes query parsing with URLSearchParams. Encode individual path or query components according to their own context.
Debugging a specific Query String issue? Browse Query String troubleshooting.