Enter the text that you wish to encode or decode:
URL encoding, also known as percent-encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). It is used to represent characters that are not allowed or are reserved for special purposes within a URL. For instance, the space character is not allowed and must be replaced with %%HTMLBLOCK0%% or a plus sign .
A URL encoder converts these characters into a % followed by two hexadecimal digits which represent the ASCII value of the character. Conversely, a URL decoder performs the reverse operation, converting these encoded sequences back into their original characters.
URLs can only be sent over the internet using the ASCII character-set. Since URLs often contain characters outside the ASCII set, they must be converted into a valid ASCII format. Encoding ensures that data passed via URLs remains intact and unambiguous.
For example, when you submit a form with special characters in the data, that data needs to be encoded to be transmitted correctly. If it's not encoded, servers might misinterpret the data, leading to errors or security issues.
The process involves converting each character in the string to one or more bytes. Each byte is then represented by a % followed by two hexadecimal digits. The standard encoding for the web is UTF-8, so each character is represented by one to four bytes.
For instance, the string would be encoded as . The decoder takes the encoded string and translates it back to the original.
| Original Character | Encoded Equivalent | | :---------------- | :----------------- | | space | %20 | | ! | %21 | | # | %23 | | $ | %24 | | & | %26 |
URL encoding is used in various web technologies: