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
![HTML Superscript text HTML Superscript text](/sites/tutorial2program/files/html-superscript-example.png)
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
![HTML Superscript text for exponents Exponents written in superscript](/sites/tutorial2program/files/html-superscript-example-2.png)
2. Superscript in measurement units
<p>The area of this park is 200m<sup>2</sup>.</p>
Browser Output
![HTML Superscript text For units of measurement Units of measurement written in superscript](/sites/tutorial2program/files/html-superscript-example-3.png)
3. Superscript in ordinal numbers
<p>Ram scored 1<sup>st</sup> position in the 100m race.</p>
Browser Output
![HTML Superscript text for ordinal numbers Ordinal position written in superscript](/sites/tutorial2program/files/html-superscript-example-4.png)
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
![HTML Subscript text HTML Subscript text](/sites/tutorial2program/files/html-subscript-example-1.png)
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
![HTML Subscript text for mathematics Mathematic formula written in subscript](/sites/tutorial2program/files/html-subscript-example-2.png)
2. Usage in Chemical Formula
<p> H<sub>2</sub>SO<sub>4</sub> is chemical formula for sulphuric acid.</p>
Browser Output
![HTML Subscript text for chemical formula Chemical formula written in subscript](/sites/tutorial2program/files/html-subscript-example-3.png)