Online URL decoding and encoding tool
Tip: Click the corresponding row to copy the conversion result.
URL Encoding/Decoding
The RFC3986 protocol has made detailed recommendations on the encoding and decoding issues of URLs, pointed out which characters need to be encoded to avoid the change of URL semantics, and made corresponding explanations for why these characters need to be encoded.
The RFC3986 protocol stipulates that URLs are only allowed to contain the following four types of characters:
1. English letters (a-zA-Z)
2. Numbers (0-9)
3. Four special characters -_.~
4. All reserved characters. The following characters are designated as reserved characters (English characters) in RFC3986: ! * ' ( ) ; : @ & = + $, /? # [ ]
This tool uses the decodeURIComponent
method of JavaScript
for decoding, and the encodeURI
and encodeURIComponent
methods for encoding.
The encodeURI
method does not encode ASCII letters, numbers, ~!@#$&*()=:/,;?+'.
The encodeURIComponent
method does not encode ASCII letters, numbers, ~!*()'.
The encodeURIComponent
has a larger encoding range than encodeURI
.
Therefore, when you need to encode the entire URL, use encodeURI
.
If you only need to encode the parameters in the URL, use encodeURIComponent
.