What is URL Encoding/Decoding?

URL encoding, or percent-encoding, is a method to encode information in a Uniform Resource Identifier (URI) in a secure and reliable way. Encoding converts reserved and non-ASCII characters in URLs into a uniform format which all web browsers and servers accept and understand. Although this process is known as URL encoding, it makes use of the main URI set which includes both Uniform Resource Name (URN) and Uniform Resource Locator (URL). URL encoding also plays an important part in preparing data of media type “application/x-www-form-unrlencoded” when submitting HTML form data via HTTP requests. So we built our own URL encode online tool.

The inverse process of URL encoding is URL decoding. URL decoding is used to parse path parameters or query strings that are passed in URLs, and to decode HTML form parameters sent with the MIME format “application/x-www-form-unrlencoded” when submitting data with HTML forms.

Why Choose HelpTricks Online URL Encoder?

HelpTricks Online URL Encoder is a free, online tool for you to encode your URL data, or decode a URL into a human-readable format, hassle-free.

Completely free!

HelpTricks Online URL Encoder is a completely free URL encode online tool. There is absolutely no need to download any software or file in order to use this tool.

Your data is safe!

We don’t keep any of your data. After being processed, uploaded files are immediately deleted from our servers. And all communication with the servers are SSL encrypted.

How Does HelpTricks Online URL Encoder Work?

URL encoding is done to map a broad range of characters that belong to many languages into a set of 60+ characters that are allowed in a URI. This is done in two steps:

  1. Convert the string of characters into a UTF-8 encoded byte sequence
  2. Convert each byte of the sequence which is not a digit or an ASCII character, into the form %HH where HH is the hexadecimal value of the character represented by the byte.

For instance, the encoded result of the string François would be Fran%C3%A7ois.

The character “ç” encoded in UTF-8 as two bytes result in hex values C3 and A, respectively, which are then converted to a three-character value like %c3 and %a7.

How Does URL Encoding/Decoding Work?

In URL encoding, certain characters in the URL are replaced by one or more character triplets, where each character triplet includes “%” (the percent character) followed by two hexadecimal digits. These hexadecimal digits represent the numeric hex value of the replaced character.

Characters Allowed in a URL

There are two types of characters that are allowed to be used in a URI: reserved, or unreserved (or percent character for percent-encoding). Unreserved characters have no special meaning, whereas reserved characters can have special meanings under certain circumstances. URL encoding, or percent-encoding, uses allowed characters to represent certain characters that are not allowed in a URI. With each revision of specifications for URI schemes presented by IANA (Internet Assigned Number Authority) the reserved and unreserved character sets and the circumstances under which some of these reserved characters represent special meanings, can change.

RFC 3986 declares that all characters in a URL must belong to a defined set of reserved and unreserved ASCII characters. Any other characters are not allowed to be included in the URL.

Reserved Characters

! * ‘ ( ) ; : @ & = + $ , / ? % # [ ]

Reserved characters must be encoded but only under certain circumstances.

Unreserved Characters

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 – _ . ~

Even though unreserved characters can be encoded, they should not be. 

Why and When To Use URL Encoding/Decoding?

When submitting data to a server with HTML forms, the form field values are encoded and sent to the server via an HTTP request message with an HTTP POST or a GET method. The default encoding mechanism used in this process results in data of application/x-www-form-unrlencoded MIME type, which is currently defined in HTML and XForms specifications. Note that this encoding mechanism is mostly outdated as it is based on an early version of the percent-encoding rules, with only certain modifications, such as replacing whitespace with “+” instead of “%20”, and newline normalization. 

When retrieving data from a server with an HTTP GET request, application/x-www-form-unrlencoded data is contained in the request URI’s query component. Subsequently, when sending data to the server via HTTP POST, the data is contained in the body of the request, with the media type defined in the request header “Content-Type”.

External Links

  1. What is URL Encoding? – Definition from Techopedia
  2. Percent-encoding – Wikipedia

Write A Comment