Français

<sub> <sup>

Writing a chemical formula or a footnote reference

  • HTML
  • accessibility
  • semantics

<sub> and <sup> — Subscripts and superscripts

The <sub> element represents a subscript (lowered text) and <sup> a superscript (raised text). They carry semantic value: chemical formulae, mathematical powers, footnote references.

When to use it

You want to write a chemical formula like H2O, a mathematical exponent like x2, or a footnote call1. Do not use them purely for visual effect.

What you gain

Accessibility: some screen readers announce "subscript" or "superscript" (NVDA does, JAWS depending on configuration). Without this announcement, H₂O is read "H 2 O" without distinction. For complex formulae, prefer MathML.

Code example

<p>The chemical formula for water is H<sub>2</sub>O.</p>
 
<p>The area of a circle is A = π<var>r</var><sup>2</sup>.</p>
 
<p>See the original study<sup><a href="#note-1">1</a></sup> for details.</p>

Further reading