URL Encoder / Decoder
How do I URL encode or decode text?
- Type or paste text into the Text box. The Encoded box shows it with percent codes such as %20.
- Type or paste an encoded text into the Encoded box to decode it. The Text box shows the original characters.
- Pick A value or path segment for one query value, A whole URL to keep the separators of an address, or Form data to write spaces as +.
- Press Copy result to copy the box you did not type in.
Which characters are encoded?
Each option leaves these characters as they are and writes every other character as percent codes.
| Option | Left as they are | Space |
|---|---|---|
| A value or path segment | A–Z a–z 0–9 - . _ ~ | %20 |
| A whole URL | A–Z a–z 0–9 - . _ ~ : / ? # [ ] @ ! $ & ' ( ) * + , ; = | %20 |
| Form data (space as +) | A–Z a–z 0–9 * - . _ | + |
A character outside the list becomes one percent code for each of its UTF-8 bytes. é becomes %C3%A9, the Chinese character 中 becomes %E4%B8%AD and an emoji becomes four codes such as %F0%9F%98%80. The percent sign itself becomes %25.
How does the decoder read a text?
The decoder reads each % followed by two hexadecimal digits as one byte and reads the bytes as UTF-8. A % that starts no code stays as it is. With Form data, a + is read as a space. Bytes outside UTF-8, such as an address encoded in Shift_JIS or EUC-KR, are shown as � with a one-line note.
Whichever of the two boxes you type into, the other one changes at once, and a space can be written as %20 or as + for form data.
Common questions
- What does %20 mean in a URL?
- It is a space. 20 is the hexadecimal code of the space character.
- Should a space be encoded as %20 or +?
- Use %20 in addresses and + only in form data.
- Why did %20 turn into %2520?
- The text was already encoded, and its percent sign was encoded again as %25.
- How are characters such as é or 中 encoded?
- Each character becomes the percent codes of its UTF-8 bytes.
- What is the difference between encodeURIComponent and encodeURI?
- encodeURIComponent encodes one value. encodeURI encodes a whole address and keeps separators such as / ? & as they are.