Query String Plus Sign Becomes Space – + vs %2B Explained

Local only

Explain form-style query decoding where + represents a space while %2B represents a literal plus sign.

26 chars · 1 line

42 chars · 4 lines

2 parameters2 unique keys

Query string decoding behavior

Why does + become a space in a query string?

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

What you can do here

  • Browser-native URLSearchParams behavior
  • Full URL and raw query parsing
  • Repeated parameter preservation
  • JSON object to query construction
  • Browser-local processing

Steps

  1. Paste the URL or raw query into Parse to JSON.
  2. Check whether the original value contains raw + or %2B.
  3. Use %2B when a literal plus sign must survive decoding.

Form-style query decoding is different from literal text

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.

+ and %2B in the same query

The parser demonstrates the two meanings side by side.

Query string

?q=hello+world&literal=%2B

Parsed JSON

{
  "q": "hello world",
  "literal": "+"
}

Common questions

Frequently asked questions

Why does + mean space?

Query strings commonly use form-style URL encoding, where + is the compact representation of a space.

How do I send a literal plus sign?

Percent-encode it as %2B.

Does this affect the URL path too?

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.