HTML <sup> Details
The <sup> tag represents superscriptâtext that appears smaller and above the baseline. Use it for exponents (e.g. x²), footnote references, or ordinal numbers (1st, 2nd). Browsers render it as superscript. Use <sub> for subscript (below the baseline).
sup vs sub
<sup> = superscript (above baseline). <sub> = subscript (below baseline). Use <sup> for exponents, footnote refs, ordinals; use <sub> for chemical formulas, variable subscripts. Both are semantic.
Best practices
Use <sup> when the meaning is superscriptâexponents, footnote refs, ordinals. Do not use it only for visual effect; prefer semantic markup. The exact style can be overridden with CSS if needed.
