%2B is the URL-encoded plus sign (+).
In a URL, %2B stands for the plus sign (+). Here is when to encode it, what it does in each part of a URL, and what every major language outputs.
Quick facts
| Character | + |
|---|---|
| Name | Plus sign |
| Unicode | U+002B |
| UTF-8 bytes | 2B (1 byte) |
| Percent-encoded | %2B |
| Lowercase form | %2b — identical meaning |
| Double-encoded | %252B |
| HTML form encoding | %2B |
| RFC 3986 class | Reserved — sub-delimiter |
What it means in a URL
In a query string the plus sign means “space” under form encoding, so a literal plus must be sent as %2B. In a path, + is just a plus sign. Phone numbers, email aliases (name+tag@…) and Base64 data are where this bites.
RFC 3986 class: Reserved — sub-delimiter. RFC 3986 allows it raw in paths and queries, but some schemes and servers give it meaning, so encoding it as data is the safe choice.
When to encode it
| Where it appears | What to do |
|---|---|
| Path segment | Allowed raw (encoding is also fine) |
| Query value | Encode — a raw + is read as a space |
| Fragment | Allowed raw |
| Form body | Encode |
The mistake to watch for
Sending ?phone=+44… or ?email=a+b@x.com unencoded — the server decodes the plus as a space.
What each language produces
Left as-is by JavaScript encodeURI(s), Go url.PathEscape(s); every other function in the table encodes it. Output for the single character, UTF-8 input, tested against the real runtimes (see the encoding comparator for your own strings).
| Function | Output | |
|---|---|---|
| JavaScript encodeURIComponent(s) | %2B | encoded |
| JavaScript encodeURI(s) | + | kept |
| JavaScript URLSearchParams | %2B | encoded |
| Python urllib.parse.quote(s) | %2B | encoded |
| Python quote(s, safe="") | %2B | encoded |
| Python urllib.parse.quote_plus(s) | %2B | encoded |
| PHP rawurlencode($s) | %2B | encoded |
| PHP urlencode($s) | %2B | encoded |
| Java URLEncoder.encode(s, UTF_8) | %2B | encoded |
| Go url.QueryEscape(s) | %2B | encoded |
| Go url.PathEscape(s) | + | kept |
| Ruby URI.encode_www_form_component(s) | %2B | encoded |
| Ruby ERB::Util.url_encode(s) | %2B | encoded |
| C# / .NET Uri.EscapeDataString(s) | %2B | encoded |
Decoding it
decodeURIComponent('%2B') returns the plus sign (+). Python: urllib.parse.unquote('%2B'); PHP: rawurldecode('%2B'). Paste any string into the URL decoder to decode it in your browser.
Common questions.
%2B is the percent-encoded form of the plus sign (+), whose byte value is 0x2B. Decoding the URL turns it back into the character.
Yes. Hex digits in percent-encoding are case-insensitive, so %2b and %2B mean the same thing. RFC 3986 recommends uppercase, and mixing cases can make caches and analytics count one URL as two.
Use your language’s encoder on the value: encodeURIComponent in JavaScript gives %2B, Python’s quote(s, safe="") gives %2B, PHP’s rawurlencode gives %2B.
More from the toolkit.
About this page. Written and maintained by Sri Murugan Systems, the developer of urlencodedecode.com. Character classes follow RFC 3986 §2; language outputs were generated by running each function in its real runtime.