When encoding a search phrase, should the space become + or %20?
%20 is correct in every part of a URL, while + means a space only inside query values sent the way forms send them; elsewhere it is a real plus sign. The tool writes %20 by default, and in 'Component' mode you can switch on writing spaces as +, or treating + as a space when decoding.
Where the two conventions come from
When you submit a search form on a website, the browser writes the fields in an older form-specific style that replaces spaces with +. That is why search result links look like q=oud+perfume. But that style belongs to the query string, the part after the ?. In the path, before it, a + stays a +, so the page /oud+perfume is not the page /oud perfume.
What the tool writes
We encoded عطر عود (oud perfume) in 'Component' mode with the default settings, and got:
%D8%B9%D8%B7%D8%B1%20%D8%B9%D9%88%D8%AF
With 'Write spaces as + instead of %20' ticked, it became:
%D8%B9%D8%B7%D8%B1+%D8%B9%D9%88%D8%AF
The whole difference is in the middle: %20 or +. The Arabic letters themselves are unchanged.
What if the text contains a real plus?
This is why the two never get mixed up. We encoded 'C++ دورة' (a C++ course) with the + option on, and the result was C%2B%2B+%D8%AF%D9%88%D8%B1%D8%A9. The two original plus signs were encoded as %2B, and only the space became +. Anyone reading the link knows + is a space and %2B is a plus sign.
And when decoding
We decoded %D8%B9%D8%B7%D8%B1+%D8%B9%D9%88%D8%AF with the default settings and got عطر+عود with a plus between the words, because the tool does not assume + is a space. With 'Treat + as a space' ticked, it gave عطر عود. Use that option when you decode a value taken from a search or form link.
Which one to choose
- If you are unsure, choose %20. It is correct in the path and the query alike, and it can only mean one thing.
- Choose + if the system receiving the link explicitly expects it, or you are reproducing a search link in the form the site itself writes.
- Never use + in a page or file name, where it reads as a plus sign.
- Open the URL encoder/decoder, choose 'Encode', then 'Component'.
- Paste the search phrase.
- Tick the + option if you need it, or leave it off to get %20.
- Copy the output and put it after the parameter name, such as ?q=.
The + option does not appear in 'Full URL' mode, because that mode leaves + alone as one of the URL structure characters. For campaign links with Arabic names containing spaces, the UTM campaign link builder encodes the values for you.
Common questions
Do Google and other sites understand %20 in search links?
Browsers decode %20 to a space in any part of a URL. How each site reads its search values is up to that site, so test the link once you build it.
Why isn't the option switched on automatically for values?
Because the tool does not know where you will put the output. %20 is safe everywhere, so it is the default.
Does the option affect Arabic letters?
No, it only changes spaces.
