URL encoding and decoding
A URL has to take on a certain format, a format that is not exactly human readable. So how then are both a human and a machine supposed to be able to read the same URL?
This lesson focuses on:
- URL encoding
- URL decoding
URL encoding
Through the process of URL encoding, a URL is converted into valid URL format. This means that certain characters in the URL are converted into their proper URL encoded value such as the space character (URL encoded value of %20). This encoding is usually performed when a form is submitted because data submitted through a form can contain special characters such as ".", "#" or the space character that can have special meanings, are not valid in a URL, or can be altered during the transfer of the data.
Generally, any character that is not a number or letter (non alphanumeric) should be URL encoded. Examples of such characters include the "!", "@", "#", "$", and "%" characters.
A list of commonly encoded characers and their encoded value:
NOTE: The number after the % sign in the encoded value is the ASCII value of the character being encoded.
NOTE: The space character can be encoded as "%20" or as "+"
| Character | Encoded value |
|---|---|
| ; | %3B |
| ? | %3F |
| : | %3A |
| # | %23 |
| & | %26 |
| = | %3D |
| $ | %24 |
| , | %2C |
| <space> | %20 or + |
| % | %25 |
| < | %3C |
| > | %3E |
| ~ | %7E |
| % | %25 |
URL decoding
Through the process of URL decoding, a URL is converted back into a string of regular characters that are human readable.
Use this URL encoder/decoder tool to encode and decode URL's:




