Introduction to HTML URL Encoding

Introduction to HTML URL Encoding

In this article, we are going to learn about HTML URL Encoding in detail. HTML URL is an acronym of Uniform Resource Locator to global or IP address on the World Wide Web. Web server gets the page using URL for the web browser.

Example: is one of the URL.

ASCII character set is important for HTML URL Encoding. URL is sent to the internet using the ASCII Character set. Non-ASCII character is restricted because of they may create conflict to find page path to the server. Because of this problem, HTML uses URL Encoding.

HTML URL Encoding, convert the Non-ASCII character into a format that can send to the internet. Users can be converted using “%” to continue with two hexadecimal digits.

How to Perform URL Encoding in HTML?

  • HTML language creates URL using <a> tag and href attribute. For Example <a href=>. if you make any website and want to go from one page to another, then write the file name. <a href=”page1.html”>.
  • Some characters are restricted to web address name because of conflict creation; non-ascii character replaces with “% ” to continue with two hexadecimal digits.
  • URL does not hold space. It takes the place of the plus sign (+) or %20. In the form of the HTML page, space occurred in “input” text output, then plus sign shows. Indirectly space occurred in URL name then %20 shows.
  • URL tag contain the uppercase letters(A- Z), and lowercase letters(a- z), decimal digits(1-9) and some special characters.
HTML URL Encoding 1-1

In the form, if I put space, then the URL Encoding comes as HTML+CSS.

<a href=”my file.html”>

In any URL, if we give space, then URL Encoding will occur as my%20file.html.

  1. Reserved Characters: There are some characters with some meaning in the URL address, and we can use naming purpose. We can use both ways, like plus (/) sign used for a separate part of URL another hand, we can / encode by %2f without meaning in the name of address.
  2. Unsafe Characters: Many characters come with many misunderstandings in the URL address, like space in the URL name. Instead of take space in URL address name <a href=”pa ge.html”>, write <a href =”pa%20ge.html”>. then the URL name seems “pa ge.html”.
  3. Non-ASCII Control Characters: These Characters Are Including the Set of An 80-Ff Hex Value, Which Is a Need to Convert in Format.
  4. ASCII Control Characters: There Are Not Working Inside of URL.

Examples of HTML URL Encoding

Following are the examples of HTML URL Encoding explained in detail: Popular Course in this categoryHTML Training (12 Courses, 19+ Projects, 4 Quizzes)12 Online Courses | 19 Hands-on Projects | 89+ Hours | Verifiable Certificate of Completion | Lifetime Access | | 4 Quizzes with Solutions
4.5 (6,502 ratings)Course Price
₹6999 ₹41999
View Course

Related CoursesBootstrap Training (2 Courses, 6+ Projects)XML Training (5 Courses, 6+ Projects)CSS Training (9 Courses, 9+ Projects)

1. Reserved Characters Encoding

Following is the Table Utilized for Encoding Reserved Characters.

URL Encode24%26%%2b%2c%2f%3a%3b%3d%3f40%

2. Unsafe Characters

Following is the Table Utilized for Encoding Unsafe Characters.

URL Encode20%22%%3c%3e23%25%%7b%7d%7c%5c%5e%7e%5b%5d

3. Non-ASCII Control Character

Following is the Table Utilized for Encoding Non-ASCII Characters.

CharacterURL EncodeCharacterURL EncodeCharacterURL EncodeCharacterURL Encode
ƒ%83š%9a­ ª%aaÁ%c1
%89 ×%d7³%b3Ç%c7

4. ASCII Control Characters

Following is the Table Utilized for Encoding Ascii Characters.

ASCII CharacterURL-Encoding
NUL – null character%00
SOH – the start of the header%01
STX – the start of the text%02
ETX – end of the text%03
EOT – end of the transmission%04
ENQ – enquiry%05
ACK – acknowledge%06
BEL – bell (ring)%07
BS – backspace%08
HT- horizontal tab%09
LF- line feed%0A
VT- vertical tab%0B
FF- form feed%0C
CR- carriage return%0D
SO- shift out%0E
SI- shift in%0F
DLE- data link escape%10
DC1- device control 1%11
DC2- device control 2%12
DC3- device control 3%13
DC4- device control 4%14
NAK- negative acknowledge%15
SYN- synchronize%16
ETB- end transmission block%17
CAN- cancel%18
EM – end of medium%19
SUB- substitute%1A
ESC- escape%1B
FS -file separator%1C
GS- group separator%1D
RS- record separator%1E
US- unit separator%1F

Importance of URL Encoding in HTML

If the URL is reserved, Unsafe, and Not ASCII Characters, then the URL address becomes more complicated and not understandable. When a web browser searches URL addresses, the Web Server searches the name or path of the URL. If the URL name is not ASCII, then it is difficult to find the URL Importance of URL Encoding in HTML.

URL address must be easy to find, universally accepted and understandable for all web browsers and also a web server. Some characters are making misunderstandings in URL because they are used for some purpose if it is not used for any purpose. That time conflict might have occurred, and the path does not get to the user.

To overcome all difficulties and make easy to user Non-ASCII characters converted into ASCII code using % to come up with two hexadecimal.


URL Encoding in HTML knows how to convert the Non-ASCII set of characters to a valid ASCII set of format. It is universally accepted, and a web browser works without any error. Encoding URL’s can be run on easily and safely. To avoid conflict of naming and purpose of naming, URL encoding is necessary.

Recommended Articles

This is a guide to HTML URL Encoding. Here we discuss the introduction of HTML URL and how to perform URL Encoding in HTML along with its examples and importance. You may also look at the following articles to learn more-

  1. Frames in HTML
  2. Alt Tag in HTML
  3. HTML Commands
  4. HTML5 Elements

Leave a Comment

Your email address will not be published. Required fields are marked *