What is URL Encoding?
URL encoding (percent-encoding) replaces characters that are unsafe or reserved in URLs with a percent sign followed by their hex code — for example a space becomes %20. It ensures URLs remain valid and unambiguous.
It is essential for query string values, which may contain spaces, ampersands, or non-ASCII characters that would otherwise break the URL.
Key points
- Replaces unsafe characters with % followed by their hex code.
- A space becomes %20 (or + in form-encoded data).
- Reserved characters like &, ? and = must be encoded inside values.
- Required for non-ASCII characters in URLs.
Example
hello world & co → hello%20world%20%26%20co
Common uses
- Encoding query-string parameter values
- Building safe links programmatically
- Submitting HTML form data
- Passing data in URLs without breaking them
Work with URL Encoding directly in your browser.
Open the URL Encoder/Decoder