URL Encode

A free online tool to encode url by using this tool


What is URL encoding?

URL encoding is the process of converting certain characters in a URL with one or more character triplets that are made up of the percent sign "%" and two hexadecimal numbers. The substituted character's numerical value is represented by the first two hexadecimal digits of the triplet.

The phrase "URL encoding" is somewhat problematic because the encoding process may be used to encode any URI (Uniform Resource Identifiers), including URNs, in addition to URLs (Uniform Resource Locators) (Uniform Resource Names). The phrase "percent-encoding" need to be chosen.

Which Characters Are Allowed in a URL?

A URI may only include reserved or unreserved characters (or a percent character as part of a percent-encoding). Unreserved characters have no particular significance at all, but reserved characters sometimes have it. Characters that would not be permitted without % are represented by permitted characters. With each edition of the standards governing URIs and URI schemes, a little adjustment is made to the sets of reserved and unqualified characters as well as the conditions under which certain reserved characters have high importance.

The characters in a URL must come from a specified set of unreserved and reserved ASCII characters, according to RFC 3986. In a URL, no other characters are permitted.

Even though they may be encoded, unreserved characters shouldn't be. These are the 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 - _ . ~

Only in exceptional cases does the encoding of the reserved letters become necessary. The symbols that are reserved are:

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

Encoding and Decoding a Text

Non-ASCII characters, such as the umlauts ä, ö, and ü, are not specified in RFC 3986 as to which character encoding table they should be encoded. It is theoretically feasible to reuse one of the 8-bit code pages for non-ASCII characters since URL encoding needs a pair of hexadecimal digits, and a pair of hexadecimal digits is equivalent to 8 bits (e.g. ISO-8859-1 for umlauts).

When and why would you use URL encoding?

The form field names and values are encoded and delivered to the server in an HTTP request message using method GET or POST, or, typically, by email, when data from HTML forms has been submitted. The default encoding is based on a very early version of the generic URI percent-encoding rules, with some changes like newline normalizing and using "+" instead of "%20" for spaces. Application/x-www-form-urlencoded is the MIME type for data encoded in this manner, and it is currently described (although in a rather archaic manner) in the HTML and XForms standards. The CGI definition also specifies how web servers should decode this kind of data and make it available to applications.

Application/x-www-form-urlencoded data is included in the query part of the request URI when it is delivered in an HTTP GET request. The data is transmitted in the body of the email or HTTP POST request, and the Content-Type header of the message contains the name of the media type.