%2B is a plus sign
%2B is a literal plus sign.
| Character | "+" |
|---|---|
| Name | Plus Sign |
| Encoded | %2B |
| Also seen as | %20 |
| Reserved | Yes — it has a special meaning in a URL |
Why it breaks things
The plus sign is the most confusing character in a URL because it means two different things depending on where it sits. In a query string — the part after the question mark — a bare plus means a space. That rule comes from HTML forms, which have encoded spaces as plus signs since the early web. In the path, a plus means an actual plus sign. So the same character reads differently either side of the question mark.
This is why a real plus sign has to be written as %2B in a query string. Phone numbers and email addresses are where it causes the most trouble: a search for +64 21 555 will arrive as a space followed by 64, and an address like [email protected] will lose its tag.
Note that decodeURIComponent in JavaScript never converts a plus to a space, so code that relies on it alone will get query strings wrong.
Real examples
Without encoding
https://example.com/search?q=+64 21 555
With encoding
https://example.com/search?q=%2B64%2021%20555
Without encoding, the leading plus is read as a space and the phone number loses its country code marker.
Without encoding
https://example.com/[email protected]
With encoding
https://example.com/signup?email=user%2Btag%40example.com
Email addresses using plus-addressing lose the tag unless the plus is encoded.
Decode something
Result
Breakdown
| Part | Value | Copy |
|---|
History
Nothing yet.
History stays in this browser. It is never sent to our server.
Common questions
- Does + always mean a space?
- No. Only in the query string, which is the part after the question mark. In the path a plus is a literal plus sign.
- Why does decodeURIComponent leave my plus signs alone?
- Because it follows the URL standard, where a plus has no special meaning. The plus-means-space rule comes from HTML form encoding, which is a separate specification. If you are decoding a query string, convert plus to space yourself first, or use URLSearchParams, which does it for you.
- Should I use %20 or + for spaces?
- %20 works everywhere in a URL. Plus only works in the query string. If you are unsure, use %20.