HTML – URL Encoding


What is an URL ?

URL stands for Uniform Resource Locator denotes the web address.

URL may contain defined group of words or IP address(127.0.0.0)

Its hard to remember the IP address, so people prefer the URL address to remember easily.

Usually Web browsers requests the  webpages from web servers by using a URL.

Example :

scheme://prefix.domain:port/path/filename

Different parts of URL

1. scheme

Defines the type of Internet service (most common is http or https).

There are different types of schemes used in URL, will be explained below.

2. prefix

Defines a domain prefix, by default for http is www.

3. domain

Defines the Internet domain name like cstechbook.com.


4. port

Defines the port number at the host by default for http port is 80.

5. path

Defines a path at the server if path is not defined by default browser loads the root directory of the website.

6. filename

Defines the name of a document or resource.

Tutorial on html !!!

Click to Learn More about – HTML Tutorial for beginners

Types of schemes used in URL

1. http(HyperText Transfer Protocol)

        This is common for web pages, Its non-encrypted form of request.

        URL begins with “http://” format.

        HTTP uses port number 80.

        HTTP is considered to be un-secure.

        HTTP Works at Application Layer.

        HTTP does not require any certificates.

2. https (Secure HyperText Transfer Protocol)

        This is Secure for web pages. Its Encrypted form of the request.

        URL starts with “https://”

        HTTPS uses port number 443.

        HTTPS is considered to be secure.

        HTTPS works at Transport Layer.

        HTTPS needs SSL Certificates.

3. ftp(File Transfer Protocol): Downloading or uploading files.

        FTP works on two ports 20 and 21.

        FTP services are provided by TCP.

        FTP need authentication for communication.

        FTP is generally suited for uploading and downloading of files by remote users.

4. file

        Denotes the file on your computer.

What is URL Encoding ?

URL encoding is the process which converts characters into a specific format, which is then transmitted over the Internet.

Usually URLs can only be sent over the Internet using the ASCII character-set.

Sometimes URLs often contains non-ASCII characters, so the URL must be converted into a valid ASCII format.

URL Encoding process is used to achieve the specific format of the URL.

How URL Encoding works ?

Normally URLs cannot contain white spaces inside.

If the URL contain spaces URL encoding normally replaces a space with a plus (+) sign or with %20.


All the non-ASCII characters in the URL will be replaced with a “%” followed by hexadecimal digits.

ASCII control characters

Character ranges 00-1F hex (0-31 decimal) and 7F (127 decimal).

DecimalHex ValueCharacterURL Encode
000 %00
101 %01
202 %02
303 %03
404 %04
505 %05
606 %06
707 %07
808backspace%08
909tab%09
100alinefeed%0a
110b %0b
120c %0c
130dcarriage return%0d
140e %0e
150f %0f
1610 %10
1711 %11
1812 %12
1913 %13
2014 %14
2115 %15
2216 %16
2317 %17
2418 %18
2519 %19
261a %1a
271b %1b
281c %1c
291d %1d
301e %1e
311f %1f
1277f %7f

Non-ASCII control characters encoding

Range is part of the ISO-Latin character set and includes the entire “top half” of the ISO-Latin set 80-FF hex (128-255 decimal).

DecimalHex ValueCharacterURL Encode
12880%80
12981%81
13082%82
13183ƒ%83
13284%84
13385%85
13486%86
13587%87
13688ˆ%88
13789%89
1388aŠ%8a
1398b%8b
1408cŒ%8c
1418d%8d
1428eŽ%8e
1438f%8f
14490%90
14591%91
14692%92
14793%93
14894%94
14995%95
15096%96
15197%97
15298˜%98
15399%99
1549aš%9a
1559b%9b
1569cœ%9c
1579d%9d
1589ež%9e
1599fŸ%9f
160a0 %a0
161a1¡%a1
162a2¢%a2
163a3£%a3
164a4¤%a4
165a5¥%a5
166a6¦%a6
167a7§%a7
168a8¨%a8
169a9©%a9
170aaª%aa
171ab«%ab
172ac¬%ac
173ad­%ad
174ae®%ae
175af¯%af
176b0°%b0
177b1±%b1
178b2²%b2
179b3³%b3
180b4´%b4
181b5µ%b5
182b6%b6
183b7·%b7
184b8¸%b8
185b9¹%b9
186baº%ba
187bb»%bb
188bc¼%bc
189bd½%bd
190be¾%be
191bf¿%bf
192c0À%c0
193c1Á%c1
194c2Â%c2
195c3Ã%c3
196c4Ä%c4
197c5Å%c5
198c6Æ%v6
199c7Ç%c7
200c8È%c8
201c9É%c9
202caÊ%ca
203cbË%cb
204ccÌ%cc
205cdÍ%cd
206ceÎ%ce
207cfÏ%cf
208d0Ð%d0
209d1Ñ%d1
210d2Ò%d2
211d3Ó%d3
212d4Ô%d4
213d5Õ%d5
214d6Ö%d6
215d7×%d7
216d8Ø%d8
217d9Ù%d9
218daÚ%da
219dbÛ%db
220dcÜ%dc
221ddÝ%dd
222deÞ%de
223dfß%df
224e0à%e0
225e1á%e1
226e2â%e2
227e3ã%e3
228e4ä%e4
229e5å%e5
230e6æ%e6
231e7ç%e7
232e8è%e8
233e9é%e9
234eaê%ea
235ebë%eb
236ecì%ec
237edí%ed
238eeî%ee
239efï%ef
240f0ð%f0
241f1ñ%f1
242f2ò%f2
243f3ó%f3
244f4ô%f4
245f5õ%f5
246f6ö%f6
247f7÷%f7
248f8ø%f8
249f9ù%f9
250faú%fa
251fbû%fb
252fcü%fc
253fdý%fd
254feþ%fe
255ffÿ%ff

Reserved Characters Encoding

Special characters such as the dollar sign, ampersand, plus, common, forward slash, colon, semi-colon, equals sign, question mark, and “at” symbol.

DecimalHex ValueCharURL Encode
3624$%24
3826&%26
432b+%2b
442c,%2c
472f/%2f
583a:%3a
593b;%3b
613d=%3d
633f?%3f
6440@%40

Tutorial on html !!!

Click to Learn More about – HTML Tutorial for beginners

Unsafe Characters Encoding

Space, quotation marks, less than symbol, greater than symbol, pound character, percent character, Left Curly Brace, Right Curly Brace, Pipe, Backslash, Caret, Tilde, Left Square Bracket, Right Square Bracket, Grave Accent. 

DecimalHex ValueCharURL Encode
3220space%20
3422%22
603c<%3c
623e>%3e
3523#%23
3725%%25
1237b{%7b
1257d}%7d
1247c|%7c
925c\%5c
945e^%5e
1267e~%7e
915b[%5b
935d]%5d
9660`%60