When to Use URL Encoding

URLs can only contain a limited set of ASCII characters. Special characters like spaces, ampersands, and non-ASCII text must be percent-encoded. For example, a space becomes %20 and the Japanese character ζ—₯ becomes %E6%97%A5.

Characters That Must Be Encoded

CharacterEncodedWhy
Space%20 or +Not allowed in URLs
&%26Query string delimiter
=%3DKey-value separator
#%23Fragment identifier
?%3FQuery string start