HTML Charsets

Last Updated : 2 Apr, 2026

HTML charsets define how characters are encoded so that text and symbols display correctly across different devices and browsers.

  • Character encoding determines how text is represented and interpreted in an HTML document.
  • The <meta> tag with the charset attribute specifies the encoding used by the webpage.
  • Setting a charset ensures proper rendering of special characters and symbols.
  • UTF-8 is the most commonly used charset as it supports multiple languages and symbols.

Common Character Encodings

Common character encodings define how text and symbols are represented for consistent display across devices and browsers.

1. ASCII

The American Standard Code for Information Interchange (ANSII) created this character encoding. This character encoding is used in C/C++ programming.

It has 128 alphanumeric characters consisting of alphabets(A-Z) and (a-z) and some special symbols like + - * / ( ) @ etc.

2. ANSI (Windows-1252)

American National Standards Institute (ANSI) created character encoding supported 256 characters. It is used as the default character set in Microsoft Windows. 

3. ISO-8859-1

It is used as the default character set of HTML4 and also supports 256 characters. The International Standards Organization (ISO) defines the standard character sets for different alphabets/languages. It contains numbers, upper and lowercase English letters, and some special characters. 

4. UTF-8

UTF-8 and UTF-16 standards was developed by Unicode Consortium, because the ISO-8859 character-sets are limited, and not compatible a multilingual environment. It consists all the character and punctuation symbols. 

Attribute

Web browser must know the character encoding standard used in the html page and this we do as given below. 

Example: 

  • HTML 4
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  • HTML 5
<meta charset="UTF-8">

Note:

  • The first values from 0 to 127 are considered as the "Standard" ASCII character set.
  • Characters with values from 128 to 255 are the "Extended" Character set.

Significance of Character Encoding

Character encoding ensures that text is correctly displayed and interpreted across different devices, browsers, and platforms, allowing consistent communication of letters, symbols, and special characters.

  • Consistency: Encoding defines how text, numbers, and symbols are interpreted, ensuring that content appears correctly regardless of the user's device or browser.
  • Global Compatibility: Without proper encoding, characters in different languages or special symbols may display as unreadable or incorrect.
  • Web Development: By specifying the charset, you avoid issues with rendering characters and improve your site’s accessibility across diverse languages

Character set for different Character Encoding Standard

Following list shows different character encoding standards with their characters and their assigned number codes.

Table 1 (ASCII Device Control Characters)

This table contains Characters which are designed to control hardware devices. These are also known as control characters.

NumbersCharactersDescriptions
00NULnull character
01SOHstart of header
02STXstart of text
03ETXend of text
04EOTend of transmission
05ENQenquiry
06ACKacknowledge
07BELbell(ring)
08BSbackspace
09HThorizontal tab
10LFline feed
11VTvertical tab
12FFform feed
13CRcarriage return
14SOshift out
15SIshift in
16DLEdata link escape
17DC1device contyrol 1 
18DC2device contyrol 2
19DC3device contyrol 3
20DC4device contyrol 4
21NAKnegative acknowledge
22SYNsynchronize
23ETBend transmission block
24CANcancel
25EMend of medium
26SUBsubstitute
27ESCescape
28FSfile separator
29GSgroup separator
30RSrecord separator
31USunit separator
127DELdelete

Table 2: This table contains characters having the same numbers assigned in different character encoding.

NUMBERCharactersDescription
32 Space
33!Exclamation Mark
34"Quotation Mark
35#Hash Sign
36$Dollar Sign
37%Percent Sign
38&Ampersand Sign
39'Apostrophe Sign
40(Opening Paranthesis
41)Closing Parenthesis
42*Asterisk Sign
43+Plus Sign
44,Comma
45-Hyphen/minus Sign
46.Full-stop
47/Slash/Divide Sign
480Number Zero
491Number One
502Number Two
513Number Three
524Number Four
535Number Five
546Number Six
557Number Seven
568Number Eight
579Number Nine
58:Colon
59;Semicolon
60<Lessthan Sign
61=Equalto Sign
62>Greaterthan Sign
63?Question Mark
64@at Sign
65ALetter A
66BLetter B
67CLetter C
68DLetter D
69ELetter E