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](http://devcdn.programiz.com/cdn/farfuture/gygshm_aAYaW_cg1w2nzvNvsbkmoMZ4Z5JY_XuE1ivs/mtime:1677313382/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](http://devcdn.programiz.com/cdn/farfuture/Ul7QgwUn-y_A_n68gvBGc3vU9Qt-6sERkFREPMKorBE/mtime:1677313381/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](http://devcdn.programiz.com/cdn/farfuture/RoIQycclfPHtG7LgYrUhJpbg2Tq1iPY8NnuJWIaojDo/mtime:1677313376/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](http://devcdn.programiz.com/cdn/farfuture/OkOBxYqKYwWPUKg_7Lrd2RcEZXSWxn5bJkmToOd31MI/mtime:1677313377/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](http://devcdn.programiz.com/cdn/farfuture/GuccFyz6pzIqWoMINiAIsWzOG3JRv2rqkmYo6PX2g7g/mtime:1677313382/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](http://devcdn.programiz.com/cdn/farfuture/A976vvuXFPj_Ry2MJAzWlcpubJ-S_GhCdmXHB8Ht8EM/mtime:1677313377/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](http://devcdn.programiz.com/cdn/farfuture/Ej1-G48qaAMKZTnSqxJ843zroEx1iG3SRef8j7VJKgk/mtime:1677313382/sites/tutorial2program/files/html-subscript-example-3.png)