URL Encoder / Decoder
Encode or decode URLs and URL components with various methods
Result
About URL Encoding
URL encoding converts characters into a format that can be transmitted over the Internet. URLs can only be sent over the Internet using the ASCII character set, so URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.
Encoding Methods Explained
- Standard URL Encoding (encodeURI) - Encodes a complete URL, preserving characters that have special meaning in URLs (/:?&=#+-.@_~).
- Component Encoding (encodeURIComponent) - Encodes URL components like query parameters, encoding all special characters including /:?&=#+-.@_~.
- UTF-8 Encoding (escape) - An older method that encodes non-ASCII characters but doesn't handle UTF-8 characters properly in all cases.
- All Methods - Applies all encoding methods sequentially for maximum encoding (rarely needed).
When to Use URL Encoding
- When creating URLs with query parameters that may contain special characters
- When submitting form data via GET requests
- When embedding user-generated content in URLs
- When working with internationalized domain names or paths
- When passing data between web applications via URLs
Common URL Encoding Examples
Character | URL Encoded | Description |
---|---|---|
Space | %20 | Spaces are encoded as %20 (or + in query strings) |
& | %26 | Ampersand separates query parameters |
= | %3D | Equals sign separates parameter names and values |
? | %3F | Question mark starts the query string |
/ | %2F | Forward slash separates path segments |
% | %25 | Percent sign is used for encoding |
+ | %2B | Plus sign (sometimes used for spaces) |
# | %23 | Hash mark indicates a fragment identifier |