Superscript
The HTML <sup>
tag is used to create superscript text. The text inside the <sup>
tag is rendered half a character above the normal line and has a smaller font size. For example,
<p> This is a <sup>Superscript</sup> text.</p>
Browser Output
Usage of Superscript
Superscript text is generally used for exponents, measurement units, and ordinal numbers. For example,
1. Superscript in exponents
<p> a<sup>2</sup> + b<sup>2</sup> = c<sup>2<sup></p>
Browser Output
2. Superscript in measurement units
<p>The area of this park is 200m<sup>2</sup>.</p>
Browser Output
3. Superscript in ordinal numbers
<p>Ram scored 1<sup>st</sup> position in the 100m race.</p>
Browser Output
Subscript
The HTML <sub>
tag is used to create subscript text. The text inside the <sub>
tag is rendered half a character below the normal line and has a smaller font size. For example,
<p> This is a <sub>Subscript</sub> text.</p>
Browser Output
Usage of Subscript
Superscript text is generally used for mathematics and chemical formulas. For example,
1. Usage in Mathematical Formula
<p> <var>x<sub>1</sub></var> … <var>x<sub>n</sub></var></p>
Browser Output
2. Usage in Chemical Formula
<p> H<sub>2</sub>SO<sub>4</sub> is chemical formula for sulphuric acid.</p>
Browser Output