URL encode and decode
Encode text so it's safe to put in a web address, or decode a URL full of codes like %20 and %E0%A4 back into readable text. Choose whether you're encoding a single query value, a whole URL or form data. Paste any web address to see it split into its protocol, host, path and parameters.
URL parts
How to use the URL encode and decode
- Choose Encode or Decode.
- Paste your text or URL. The result updates as you type.
- When encoding, pick what you're encoding: a single value, a whole URL, or form data.
- Copy the result. If the input or result is a full URL, its parts are listed below.
How it works
URLs can only contain a limited set of characters. Anything else, such as spaces, Hindi letters or symbols like & and #, is replaced by percent encoding: a % sign followed by the character's byte value in hex. A space becomes %20, and é becomes %C3%A9 (two bytes in UTF-8).
| Option | Keeps as is | Use it for |
|---|---|---|
| Single value (encodeURIComponent) | Letters, digits and - _ . ! ~ * ' ( ) | A search term or parameter value |
| Whole URL (encodeURI) | The above plus : / ? # & = + and others | A full address with spaces or non-English letters |
| Form data | Like a single value, but spaces become + | Data sent by HTML forms |
Which to choose? If you're building a link like /search?q= + text, encode the text as a single value; otherwise an & inside it would start a new parameter. Use whole URL only to tidy an address that's already correctly structured.
Decoding also turns + into a space, as forms do.
Example
emi calculator & more encoded as a single value becomes emi%20calculator%20%26%20more.
The Hindi word हिंदी becomes %E0%A4%B9%E0%A4%BF%E0%A4%82%E0%A4%A6%E0%A5%80.
Frequently asked questions
What does %20 mean in a URL?
It's an encoded space. Browsers can't put a real space in a web address, so it's written as %20 (or + in form data).
What's the difference between encodeURI and encodeURIComponent?
encodeURIComponent encodes everything except a few safe characters, so it's right for a single value. encodeURI leaves the characters that give a URL its structure (: / ? & = #) alone, so it's for whole addresses.
Why do Hindi and other non-English URLs look so long?
Each non-English character takes two to four bytes in UTF-8, and each byte becomes a three-character %XX code. Browsers usually show the readable version in the address bar.
Why do I get an error when decoding?
A % sign must be followed by two hex digits. A lone % or something like %G1 can't be decoded. Encode the % itself as %25 if it's meant literally.
Last updated: 25 October 2026