What’s ASCII HTML?

Print anything with Printful



ASCII HTML is a set of special codes used in HTML documents to display characters not available on a keyboard or control characters used in markup language. It consists of 128 characters that can fit into 7 bits of a byte, with an extended set of 128 additional characters. To use ASCII HTML, characters must be described in an escape code. It can be useful for non-standard characters and control characters within HTML. Unicode offers a larger selection of characters.

The characters frequently used in Hypertext Markup Language (HTML) documents are largely based on the original character set established by the American Standard for Information Interchange (ASCII). This means that ASCII HTML is actually a series of special codes that can be inserted into an HTML document to display special characters that are not available on a keyboard or are control characters used in markup language. Characters can be represented in different ways, but commonly begin with an ampersand symbol, followed by numbers or letters, and completed with a semicolon. While it’s not necessary to use ASCII HTML characters, especially if they can be generated with a keyboard, it can sometimes be useful if a non-standard character is used on a website. While an HTML ASCII character accurately maps to the correct character within a font, some documents use the Unicode® character set which can offer a much larger selection of characters.

The ASCII character set consists of 128 characters that can fit into 7 bits of a byte. An extended character set that uses all 8 bits of a byte includes 128 additional characters. Fonts include all English language letters and numbers, as well as all symbols that can be created on a standard English keyboard. In addition, there are several versions of commonly used letters with umlauts and other accents. The symbols for various national currencies, mathematical operations and frequently used commercial symbols are also part of the basic ASCII set.

To use ASCII HTML in an HTML document, the character must be described in a special sequence known as an escape code. It begins with an ampersand followed by a pound and then the decimal number of the ASCII character or a textual representation of the character. An example is the symbol to indicate a copyright. The copyright symbol is the decimal number 169 in the ASCII character set and can be written as the copy of the word in an HTML escape code. This means that the character can be included in an HTML document as © or as ©, with the semicolon at the end needed to complete the code.

An important use for ASCII HTML codes is to represent characters that are typically used as control characters within HTML. Characters such as the greater-than and less-than symbols are used to denote tags in HTML. To display one of these characters it is necessary to use the HTML ASCII escape code instead of the typed symbol because, otherwise, the page code could be damaged and prevent the correct display of the site.




Protect your devices with Threat Protection by NordVPN


Skip to content