Why a plus sign stays a plus sign in the URL component decoder
In a URL component, a space is written %20 and a plus sign stays a plus sign. Some form data uses a plus for a space instead. This guide shows how the decoder treats each case and why the difference matters.
Two conventions for a space
Two conventions for writing a space in a URL-related string exist side by side. Percent encoding, defined in RFC 3986, writes a space as %20 and treats the plus sign as an ordinary character that may carry a special meaning chosen by the application. The older form encoding used for HTML form submissions, called application/x-www-form-urlencoded, writes a space as a plus sign and writes a literal plus as %2B. The two rules produce text that looks alike. A string such as red+blue means a plus between two words in one convention and a space between them in the other, and the string alone does not say which applies.
What this decoder does with a plus
The decoder here performs component decoding. It converts percent escapes to bytes and reads them as UTF-8, and it does nothing to a plus sign. The first worked case therefore leaves red+blue as red+blue. The second decodes red%20blue to red blue, because %20 is a space escape. The third decodes red%2Bblue to red+blue, because %2B is the escape for a plus sign. Together the cases show all three possibilities: a literal plus, an encoded space and an encoded plus. The output of this tool is a statement about component decoding and carries no claim about how any other system would read the same text.
Where the confusion arises
A complete URL, a path segment and a form field do not share every parsing rule. A browser sends the fields of an HTML form with the plus convention. A server library that parses a query string usually applies the form rule and turns plus signs into spaces. A function that decodes a single path segment or a general component usually does not, and it returns the plus unchanged. In JavaScript, decodeURIComponent leaves plus signs alone, while URLSearchParams converts them to spaces. In Python, urllib.parse.unquote leaves them, while unquote_plus converts them. A value can therefore change depending on which function touches it.
The telephone number problem
A classic failure involves international phone numbers. The number +15551234567 starts with a plus. If it is placed unencoded in a query string and the server applies the form rule, the plus becomes a space, and the application receives the text 15551234567 with a leading space. Encoding the plus as %2B avoids the problem, and the value then reads +15551234567 under both conventions. The same issue affects email addresses with plus tags such as name+tag@example.com, base64 text that contains plus characters and mathematical expressions. Any literal plus that is sent through a query string should be encoded as %2B unless you control the parser.
Encoding side of the same question
When producing a component, the safest choice is to encode a space as %20 and a plus as %2B. Component encoders in common languages do this. The result is valid under both conventions, because a form-style parser also understands %20 as a space. The plus form for spaces is safe only if you know the receiver applies the form rule. Producing %20 avoids that assumption. The cost is a slightly longer string, three characters in place of one for each space, which is rarely a concern outside very tight length limits. For a value like red blue, the component encoding is red%20blue, and for red+blue it is red%2Bblue. The two outputs stay distinct, which is the point of encoding in the first place.
Comparing parser behavior before changing data
If another system displays spaces where this tool shows plus signs, the difference comes from the parser and not necessarily from a fault in the data. Before editing the source value, find out which rule the other system applies. Look at its documentation, test it with a known value such as a%2Bb and a+b, and compare. A system that returns a+b for both inputs is treating plus as literal, and one that returns a b for the second is applying the form rule. Changing the source to match one parser can break another, so identify the rule and keep the data in its correct form.
Whole query strings are not components
A query string has structure: names, values, equals signs and ampersands. Parsing it involves splitting on those delimiters, decoding each name and value, and applying whatever convention the application uses for plus signs and repeated names. A component decoder works on a single piece of text and has none of that logic. Feeding it a whole query string such as title=red+blue&page=2 returns the same text with only the percent escapes changed. If you need the structured result, use a query parser. If you need to inspect a single value, extract that value and decode it alone.
Reserved characters in RFC 3986
RFC 3986 lists the plus sign among the sub-delimiters, a set of reserved characters that includes the exclamation mark, dollar sign, ampersand, apostrophe, parentheses, asterisk, comma, semicolon and equals sign. A reserved character has no fixed meaning in the standard itself. Each URI scheme or application may assign one, which is why the same plus sign can mean a space in a form and a literal plus in a path. The unreserved set is the letters, digits, hyphen, period, underscore and tilde, and those never need encoding. Knowing which category a character belongs to tells you when encoding is optional and when it is needed to preserve meaning.
What to do when meaning is uncertain
When you cannot tell which convention a value used, keep the original text and test both readings. Decode it as a component, and decode it again with the form rule that turns plus signs into spaces, then see which result makes sense in context. A product title with plus signs between words suggests form encoding, while a phone number with a leading plus suggests a literal plus. If the producer is under your control, change it to emit %20 and %2B so that the text means the same thing everywhere. If it is not, document the convention next to the data so the next reader does not have to reconstruct it. A short note in the field description, such as plus signs are literal or plus signs mean spaces, costs one line and prevents a debugging session later. When data moves between teams, include one example value that contains a plus sign and its expected decoded form.
Reproduce the checks
Literal plus
Open the Url Encoder Decoder and enter:
- Calculation mode
decode- Text or encoded input
red+blue
Expected output:
Text
red+blueComponent decoding leaves the plus character intact.
Encoded space
Open the Url Encoder Decoder and enter:
- Calculation mode
decode- Text or encoded input
red%20blue
Expected output:
Text
red blueThe percent escape represents a space.
Encoded plus
Open the Url Encoder Decoder and enter:
- Calculation mode
decode- Text or encoded input
red%2Bblue
Expected output:
Text
red+blueThe plus is data in this component.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.
Sources
- Primary definition and convention reference ↗ · 2026-10-08