sup and sub
<sup> marks superscript (above the baseline), <sub> marks subscript (below). Both are inline, don't break the line, and have semantic meaning.
Mathematics
E = mc2
(a + b)n = Σnk=0 C(n, k) an−k bk
∫ab f(x) dx
log2(256) = 8
Chemistry
H2O — water
C6H12O6 — glucose
CO2 + H2O → C6H12O6 + O2
Typography use cases
- Footnotes1 and endnotes2
- Copyright dates: © 2024 Acme Corp
- Registered trademark: Acme®, Widget™
- Ordinals: 1st, 2nd, 3rd, 4th
- Abbreviations with subscripts: CO2, CPUmax
Rule of thumb
<sup>— anything raised above: powers, ordinals, footnote markers<sub>— anything lowered: chemical formulas, log bases, variable indices- Don't use these purely for styling where semantics don't apply — use CSS
vertical-aligninstead
Both elements are legitimate inline semantic markup. Unlike CSS vertical-align, screen readers announce them distinctly and they participate correctly in text wrapping.