<sup> Tag in HTML | Superscript Text

The <sup> tag in HTML is used to define superscript text. Superscript text appears smaller than the regular text and is positioned slightly above the normal text. It is commonly used for mathematical expressions, footnotes, and chemical formulas.

Key Points on <sup> Tag:

Syntax of <sup> Tag:

Syntax Example

<sup>Superscript Text</sup>

Example of <sup> Tag in HTML:

This example demonstrates how to use the <sup> tag to display superscript text.

Code Example

<!DOCTYPE html>
        <html lang="en">
        <head>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>HTML Sup Tag Example</title>
        </head>
        <body>
            <p>This is an example of a superscript: E = mc2.

<p>In the chemical formula for water, the subscript shows that there are two hydrogen atoms: H2O.</p> </body> </html>

Output

This is an example of a superscript: E = mc2.

In the chemical formula for water, the subscript shows that there are two hydrogen atoms: H2O.

The <sup> tag is a simple yet useful tool for adding superscript text in HTML. It is essential for displaying mathematical notations, footnotes, and scientific formulas.