HTML <sup> Element

The HTML <sup> element represents superscript text that is displayed above the normal text baseline according to established typographical conventions.

Syntax

<p>The area of a square is measured in m<sup>2</sup>.</p>

The <sup> element requires both an opening and closing tag. Browsers normally display its contents using a smaller font positioned above the normal text baseline.

Attributes

The <sup> element supports the global HTML attributes. It does not have any element-specific attributes.

Example

This example uses the <sup> element to display exponents and an ordinal indicator using superscript text.

Play in Editor

Usage Notes

Use the <sup> element when text needs to appear as superscript because of an established typographical convention rather than simply to create a visual effect.

Common uses include exponents in mathematical expressions, ordinal indicators, footnote references, and other notation that conventionally appears above the normal text baseline.

The <sup> element should not be used solely to make text smaller or move it upward. Use CSS when the desired change is purely presentational.

For text that conventionally appears below the normal baseline, use the <sub> element instead.

For complex mathematical expressions, MathML may provide more appropriate semantic markup than combining ordinary text with <sub> and <sup> elements.

Accessibility

Use the <sup> element only when the raised text position is meaningful to the notation being presented. This preserves the intended structure instead of using CSS alone to imitate superscript text.

When superscript is used for a footnote reference, provide a clear way for users to locate the corresponding footnote. Specialized scientific or mathematical notation may also benefit from additional explanatory text when its meaning is not obvious.

Browser Support

Baseline: Widely available indicates a feature has been supported by core browsers for at least 30 months. At this stage, the feature is considered stable and safe for most websites to use without needing to worry about compatibility issues or fallbacks, as it is supported by the vast majority of users' devices and browser versions.

For detailed browser compatibility information, see Can I Use: HTML <sup> Element .

The <sup> element is closely related to the <sub> element for subscript text and the <math> element for mathematical expressions using MathML.

Specifications

HTML Living Standard: The <sup> Element