URL Encoder/Decoder
Encode and decode URLs and query strings
Quick Reference:
About This Tool
URL encoding, also known as percent-encoding, is a mechanism for encoding information in a URI (Uniform Resource Identifier). It replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits representing the character's ASCII code.
Why URL Encoding is Necessary
URLs can only contain a limited set of characters from the ASCII character set. Special characters, spaces, and non-ASCII characters must be encoded to be safely transmitted in URLs. URL encoding ensures that data is properly formatted and won't break the URL structure or cause security issues.
Common Use Cases
- Query Parameters: Encoding search terms and form data in URLs
- API Requests: Safely passing parameters to REST APIs
- Special Characters: Handling spaces, &, =, ?, and other reserved characters
- International Text: Encoding non-ASCII characters like Chinese, Arabic, or emoji
- Data Transmission: Safely transmitting user input through URLs
Component vs Full URL Encoding
encodeURIComponent encodes all special characters except: A-Z a-z 0-9 - _ . ! ~ * ' ( ). Use this for encoding individual URL parameters or query string values. encodeURI preserves URL structure characters like :, /, ?, and & while encoding other special characters. Use this for encoding complete URLs while maintaining their structure.
Reserved Characters
Reserved characters in URLs include: ! * ' ( ) ; : @ & = + $ , / ? # [ ]. These characters have special meaning in URLs and must be encoded when used as data. For example, a space becomes %20, an ampersand (&) becomes %26, and a forward slash (/) becomes %2F when used as data rather than URL structure.