Table of Contents
INTRODUCTION
The HTML <sub> element is used to make text appear as subscript. According to Merriam-webster Dictionary subscript is a distinguishing symbol (such as a letter or numeral) written immediately below or below and to the right or left of another character
In HTML the subscript is shown by browser with lower baseline and smaller font-size. It is mostly used for typographical (design or style of writing text) conventions of language and not for appearance purposes. The below image will make it clear.

Common use cases are as follows.
- Mathematical variables - In mathematical coordinate system, the points on coordinate axes are represented x1 -- xn where numbers are written as subscripts.
- Chemical formulas - In chemistry the number of atoms of an element is written as subscripts. for example: H2O
- footnote numbers - They are small numbers that appears in text. They correspond to additional information or cite the source which is provided at bottom of passage for example: annual1.
<sub> - TEXT - </sub>
Example:
<p> The chemical formula of water is H<sub>2</sub>O
</p>
Output:
The chemical formula of water is H2O
Tag Omission
The HTML <sub> element must have both start tag and end tag.
ATTRIBUTES
The <sub> element only has global attributes.
Frequently Asked Questions (FAQ)
What is the sub tag in HTML?
How do you use the sub tag in HTML?
Example:
<sub> - TEXT - </sub>
Is it possible to apply both subscript and superscript to a single HTML element?
Example:
X<sub>1</sub><sup>2</sup>
X12