Tools Coverters

URL Encoding Demystified - A Detailed Overview

URL Encoding Demystified - A Detailed Overview Image

Published Date: September 9, 2022

Updated Date: September 9, 2022

What is URL Encoding

URL Encoding is converting certain characters entered as part of the URL into a format that can be used to transmit over the internet. URL Encoding is achieved by converting or replacing one or more characters in the URL with their equivalent ASCII character set

URL Encoding as a process will replace any unsafe ASCII characters with a % followed by 2 Hexadecimal digits HH. In addition, URLs cannot contain spaces, so part of the URL encoding space is usually replaced with a + or %20

For Example: Consider the text François it will be encoded to Fran%C3%A7ois. Here the character ç is encoded in UTF-8 format.

Another Example: Günter it will be encoded to G%C3%BCnter

URL Encoding is also called percent-encoding because all the special characters are converted to a % followed by a two-digit Hex code HH. The other reason why it is called percent-encoding is that the Encoding may not only apply to URLs (Unified Resource Locators), but it can also be extended and applied to URIs (Unified Resource Identifiers)

URL Encoding is also used in preparing data that needs to be submitted in HTML forms with the content-type of application/x-www-form-urlencded

Characters allowed in a URL

There are various characters that are allowed and various characters that are disallowed to be a part of a URL. The characters that are allowed can either be reserved or unreserved characters. Reserved characters are the ones that have certain special significance. The unreserved characters have no such special significance and represent themselves as is.

As per RFC 3986, the characters in a URL should be formed of either a reserved or unreserved ASCII character set.

The unreserved character set includes letters a-z and uppercase letters A-Z along with numbers 0-9. In addition, they also include - _ . ~

The reserved character set includes the below and usually is encoded whenever found in a URL

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

URL Encoder

URL encoder or URI encoder is a simple online tool for encoding URLs or Strings that need to follow the UTF-8 standards. You can just paste or type in a string or a URL in the Encode Content box, and we will do the url-encoding or percent-encoding for you in real time. Once the string or URL is encoded, you can simply click on the button to "Copy Encoded Content" which will copy the encoded content to your clipboard.

Why do we need URL encoding?

URL encoding is needed whenever you have a URL with any reserved characters. For example, if you have a space in your URL, the browser won't exactly understand the address you are trying to access. So, you will need to encode your URL to have %20 equivalent for the space. So, with URL encoding, you can actually use reserved characters in a URL without actually confusing the browser.

What are ASCII characters

ASCII stands for "American Standard Code for Information Interchange". ASCII was the first character set (encoding standard) used between computers over the internet. ISO-885901(the default format for html 4.01) and UTF-8 (the default format for HTML5) are built on ASCII

ASCII consists of a 7-bit character set containing a total of 128 characters. ASCII contains the numbers from 0 to 9, lower case English letters from a to z, and some special characters ! * ' ( ) ; : @ & = + $ , / ? % # [ ]

ASCII character set

To see the complete list of ASCII character sets, please check out here

There are many applications that require you to encode your URL into a format that the systems can understand. If you wish to encode a URL, check out our free online URL Encoder.

Some systems communicate with encoded URLs, so you may need to decode a URL. If you want to decode a URL online, we have our free online URL Decoder.