URL Encoding Guide
Learn how URL encoding works and why it's important for web development.
What is URL Encoding?
URL encoding converts characters into a format that can be transmitted over the Internet.
Why is URL Encoding Necessary?
- Safety
- Compatibility
- Data Integrity
Common Special Characters
| Character | Encoded | Description |
|---|---|---|
| Space | %20 | Replaces spaces |
| ! | %21 | Exclamation mark |
| # | %23 | Hash/Pound |
| $ | %24 | Dollar sign |
| & | %26 | Ampersand |
| = | %3D | Equals |
| @ | %40 | At sign |
Characters That Don't Need Encoding
- A-Z
- a-z
- 0-9
- -
- _
- .
- ~
URL Encoding vs Component Encoding
Component encoding is more aggressive and encodes more characters.
Example
Original: https://example.com/search?q=hello world&lang=en
Encoded: https://example.com/search?q=hello%20world&lang=en