URL Encoder
Encode text for safe use in URLs, query parameters, and form data
Encoding Configuration
Common Examples
Input: "Hello World!"
encodeURIComponent: Hello%20World%21
encodeURI: Hello%20World!
with + for spaces: Hello+World%21
encodeURI: Hello%20World!
with + for spaces: Hello+World%21
Input: "[email protected]"
encodeURIComponent: user%40example.com
encodeURI: [email protected]
encodeURI: [email protected]
Input: "price: $19.99 & tax"
encodeURIComponent: price%3A%20%2419.99%20%26%20tax
with + for spaces: price%3A+%2419.99+%26+tax
with + for spaces: price%3A+%2419.99+%26+tax
💡 Tips
- • encodeURIComponent() encodes all special characters except: A-Z a-z 0-9 - _ . ~ * ' ( )
- • encodeURI() preserves URL structure by not encoding: : / ? # [ ] @
- • Use + for spaces in form data (application/x-www-form-urlencoded)
- • Use %20 for spaces in URL paths and query parameters
- • Custom encoding gives you full control over which characters get encoded
- • Always encode user input before including it in URLs to prevent XSS attacks