HTML <sub> Tag

The <sub> tag is used to define the subscript text that appears half a character below the line, and is rendered in a smaller font. Subscript text is often used for defining chemical formulas.

To define superscript text, use the <sup> tag.


The content of the tag is between the opening (<sub>) and the closing (</sub>) tags.


<!DOCTYPE html>
    <title>Title of the document</title>
    <p>Formula of water - H<sub>2</sub>O,  formula of alcohol - C<sub>2</sub>H<sub>5</sub>ОН</p>



The <sub> tag supports the Global attributes and the Event Attributes.

Browser support

Related articles