How it works
Encode a query value or another individual URL component using encodeURIComponent rules. Separators such as &, =, and / are encoded along with spaces and non-ASCII characters.
Enter London & Paris to encode a search value containing spaces and an ampersand. Use this for a value inside a URL rather than encoding an already assembled address.
Input and output example
Input text
London & Paris / search value
Tips
Encoding twice changes percent signs into %25. Encode the original value once and check that your URL-building code does not encode it again.
Limits
This tool does not validate or shorten URLs. Spaces become %20 rather than the plus sign used by form-urlencoded data.
Common questions
Should I encode the whole address?
No. Encoding https://example.com/?q=a b produces https%3A%2F%2Fexample.com%2F%3Fq%3Da%20b, which no longer works as an address. Encode only the value, so a b becomes a%20b, and then place it after q=.
Which characters stay unchanged?
Letters A–Z and a–z, digits 0–9, and the characters - _ . ! ~ * ' ( ) stay as they are. Everything else is encoded, including spaces, &, =, /, ?, and #.
Why does é become %C3%A9?
Characters outside ASCII are first converted to UTF-8 bytes, and each byte is written as % followed by two hexadecimal digits. é uses two bytes, so it becomes %C3%A9.