Enter text to convert to URL-safe format
Hello World
100% & <>
/my/path?with=[brackets]
café résumé
URL encoding follows specific rules to ensure URLs can be transmitted properly:
: / ? # [ ] @ ! $ & ' ( ) * + , ; =
Space, quotation marks, percent sign, angle brackets, backslash, caret, backtick, curly braces, pipe, and tilde
URL encoding replaces these characters with a % symbol followed by their hexadecimal ASCII value. For example, a space becomes %20, and a plus sign (+) becomes %2B.
Alphanumeric characters (A-Z, a-z, 0-9) and certain special characters like - _ . ! ~ * ' ( ) don't need to be encoded and remain unchanged.
URL encoding is essential in various web development and internet communication scenarios:
When forms are submitted with GET requests, the data must be URL-encoded before being sent in the URL. This ensures special characters don't break the request.
Many APIs require parameters to be URL-encoded, especially when passing complex data in query parameters or when constructing REST API paths.
When creating links with custom parameters or special characters, URL encoding ensures the links work correctly when shared via email, social media, or messaging apps.
URLs containing non-ASCII characters (like Chinese, Japanese, or Arabic text) need proper encoding to be valid and function correctly across different systems.
In JavaScript, you can use these built-in functions for URL encoding and decoding:
// Encoding
const encoded = encodeURIComponent('Hello World & Special Chars');
// Result: Hello%20World%20%26%20Special%20Chars
// Decoding
const decoded = decodeURIComponent('Hello%20World%20%26%20Special%20Chars');
// Result: Hello World & Special Chars