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: https://www.google.com 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=https://www.google.com/>. 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.

Characters$&+,/:;=?@
URL Encode24%26%%2b%2c%2f%3a%3b%3d%3f40%

2. Unsafe Characters

Following is the Table Utilized for Encoding Unsafe Characters.

Charactersspaceโ€œ<>#%{}|\^~[]
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
โ‚ฌ%80หœ%98ยซ%abยฟ%bf
โ€š%82โ„ข%99ยฌ%acร€%c0
ฦ’%83ลก%9aยญ ยช%aaร%c1
โ€ž%84โ€บ%9bยฎ%aeร‚%c2
โ€ฆ%85ล“%9cยฏ%afรƒ%c3
โ€ %86ย%9dยฐ%b0ร„%c4
โ€ก%87ลพ%9eยฑ%b1ร…%c5
ห†%88ลธ%9fยฒ%b2ร†%v6
โ€ฐ%89 ร—%d7ยณ%b3ร‡%c7
ล %8aยก%a1ยด%b4รˆ%c8
โ€น%8bยข%a2ยต%b5ร‰%c9
ล’%8cยฃ%a3ยถ%b6รŠ%ca
ลฝ%8eยค%a4ยท%b7ร‹%cb
โ€˜%91ยฅ%a5ยธ%b8รŒ%cc
โ€™%92ยฆ%a6ยน%b9ร%cd
โ€œ%93ยง%a7ยบ%baรŽ%ce
โ€%94ยจ%a8ยป%bbร%cf
โ€ข%95ยฉ%a9ยผ%bcร%d0
โ€“%96โ€”%97ยฝ%bdร‘%d1
รฃ%e3รž%deยพ%beร’%d2
รฆ%e6รŸ%dfร˜%d8ร“%d3
รค%e4ร %e0ร%ddร”%d4

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.

Conclusion

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 *