HTML Charset
HTML
The HTML character set attribute specifies the character encoding for the document, ensuring that text, symbols, and special characters are displayed correctly by web browsers. By using HTML charset attribute browser ensures loading correct character set and display anything in html page properly.
HTML Character Encoding
➔ There are various types of character encoding.
➔ ASCII Character Set: American Standard Code for Information Interchange. It supports 128 character set.
➔ ANSI Character Set:American National Standard Institute. It supports 256 character set.
➔ ISO-8859-1 Character Set: Same as ASCII but It supports 256 character set.
➔ UTF-8 Character Set: UTF-8 character encoding covers almost all of the characters and symbols in the world.
➔ The cahrset attribute is used in <meta> tag like below.
<meta charset="UTF-8">
Learning with HTML Editor "Try it Now"
You can edit the HTML code and view the result using online editor.
Example
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta charset="UTF-8">
</head>
<body>
<p>Example charset Attribute.</p>
<h1>"Heading big"</h1>
<h2>(Heading smaller)</h2>
<p>[Paragraph1]</p>
<p>{Paragraph2}</p>
<p>Note: "", (), [], {} char are printed using their dec values and hex values. </p>
</body>
</html>
Click on the "Try it Now" button to see how it works.
UTF-8 Characters
Hex 0000-007F / Dec 0-127
The characters in the range 0 - 31 and 127 were designed to control hardware devices in ASCII.
| Char | Dec | Hex | Name |
|---|---|---|---|
| 32 | 0020 | SPACE | |
| ! | 33 | 0021 | EXCLAMATION MARK |
| " | 34 | 0022 | QUOTATION (&quot;) |
| # | 35 | 0023 | NUMBER SIGN |
| $ | 36 | 0024 | DOLLAR SIGN |
| % | 37 | 0025 | PERCENT SIGN |
| & | 38 | 0026 | AMPERSAND (&) |
| ' | 39 | 0027 | APOSTROPHE |
| ( | 40 | 0028 | LEFT PARENTHESIS |
| ) | 41 | 0029 | RIGHT PARENTHESIS |
| * | 42 | 002A | ASTERISK |
| + | 42 | 002B | PLUS SIGN |
| , | 44 | 002C | COMMA |
| - | 45 | 002D | HYPHEN-MINUS |
| . | 46 | 002E | FULL STOP |
| / | 47 | 002F | SOLIDUS/SLASH |
| 0 | 048 | 0030 | DIGIT ZERO |
| 1 | 049 | 0031 | DIGIT ONE |
| 2 | 050 | 0032 | DIGIT TWO |
| 8 | 056 | 0038 | DIGIT EIGHT |
| 9 | 057 | 0039 | DIGIT NINE |
| : | 058 | 003A | COLON |
| ; | 059 | 003B | SEMICOLON |
| < | 060 | 003C | LESS-THAN (&lt;) |
| = | 061 | 003D | EQUALS SIGN |
| > | 062 | 003E | GREATER-THAN (&gt;) |
| ? | 063 | 003F | QUESTION MARK |
| @ | 064 | 0040 | AT |
| A | 065 | 0041 | LATIN CAPITAL LETTER A |
| B | 066 | 0042 | LATIN CAPITAL LETTER B |
| C | 067 | 0043 | LATIN CAPITAL LETTER C |
| X | 088 | 0058 | LATIN CAPITAL LETTER X |
| Y | 089 | 0059 | LATIN CAPITAL LETTER Y |
| Z | 090 | 005A | LATIN CAPITAL LETTER Z |
| [ | 091 | 005B | LEFT SQUARE BRACKET |
| \ | 092 | 005C | REVERSE SOLIDUS |
| ] | 093 | 005D | RIGHT SQUARE BRACKET |
| ^ | 094 | 005E | CIRCUMFLEX ACCENT |
| _ | 095 | 005F | LOW LINE |
| ` | 096 | 0060 | GRAVE ACCENT |
| a | 097 | 0061 | LATIN SMALL LETTER A |
| b | 098 | 0062 | LATIN SMALL LETTER B |
| c | 099 | 0063 | LATIN SMALL LETTER C |
| x | 120 | 0078 | LATIN SMALL LETTER X |
| y | 121 | 0079 | LATIN SMALL LETTER Y |
| z | 122 | 007A | LATIN SMALL LETTER Z |
| { | 123 | 007B | LEFT CURLY BRACKET |
| | | 124 | 007C | VERTICAL LINE |
| } | 125 | 007C | RIGHT CURLY BRACKET |
| ~ | 126 | 007D | TILDE |