Markdown Sub & Superscript
Last updated: 2026-10-14
Sub & Superscript Common extension
An extension. H~2~O subscript and X^2^ superscript, wrapped in single ~ or ^. Supported by Pandoc and markdown-it-sub/sup; not by GitHub. Essential for chemistry and math.
| Group | GFM Extensions |
|---|---|
| Spec level | Common extension |
| Spec version | CommonMark 0.31.2 + GFM |
📝 Syntax
H~2~O subscript
X^2^ superscript
▶ Live Example
Edit Markdown on the left, see the result on the right
💡 Key points
⚠️ Warning GitHub does not support it; fall back to HTML <sub> and <sup>.
ℹ️ Note For real math use KaTeX/MathJax with $$; sub/sup is for lightweight cases.
❓ FAQ
Q How to subscript on GitHub?
A Use HTML: <sub>2</sub> and <sup>2</sup>.
Q Does it clash with footnotes?
A No — ^2^ is inline superscript, [^1] is a footnote marker; parsers distinguish them.
Q Can the wrapped content contain spaces?
A Most implementations reject spaces: H~2~O works, spaced content does not.