Why URLs need encoding
URLs can only contain a limited set of characters. Spaces, ampersands and non English letters must be converted into a percent sign followed by two hexadecimal digits, a process called percent-encoding.
When you need it
- Building a link that contains spaces or special characters
- Passing a value as a query parameter
- Debugging a link that broke after being copied
A space becomes %20
For example, the text "hello world" encodes to "hello%20world". Decoding reverses the process, turning the escapes back into readable characters.
Frequently asked questions
What does %20 mean in a URL?
It is the encoded form of a space character.
Should I encode a whole URL or just part of it?
Encode the values you add to a URL, not the scheme and domain, which are already valid.
Is encoding the same as encryption?
No, it is reversible by anyone and hides nothing.