<sup>

The HTML <sup> element formats text as superscript, positioning it above the baseline. This is often used for footnotes, exponents, and mathematical expressions.

<sup> Tag

The <sup> tag in HTML is used to create superscript text, positioning it slightly above the standard text line. It is often utilized for footnotes, exponents, and chemical formulas.

Syntax

index.html
<sup>Superscripted Text</sup>

sup Demo

Example of superscript text:

The sub and sup elements

This text contains subscript text.

This text contains superscript text.

index.html
<h1>The sub and sup elements</h1>
<p>This text contains <sub>subscript</sub> text.</p>
<p>This text contains <sup>superscript</sup> text.</p>

Definition and Usage

The <sup> tag defines superscript text, which appears slightly raised above the normal text and is often displayed in a smaller font. It is commonly used for references, mathematical expressions, and chemical equations.

For subscript text, use the <sub> tag.

Attributes

  • <sub> – Defines subscript text.
  • MathML elements such as <msub>, <msup>, and <msubsup> are used for advanced mathematical notation.
  • The CSS vertical-align property can be used to adjust text positioning.

Conclusion

The <sup> tag is useful for formatting superscript text, making it ideal for footnotes, mathematical expressions, and chemical symbols. It improves readability by differentiating specialized content from standard text. For subscript formatting, the <sub> tag should be used.