How to write subscript text in markdown using tilde syntax or HTML. Syntax, examples, and platform support.
Subscript text appears below the normal baseline at a smaller size, used for chemical formulas (H₂O), mathematical notation, and technical content. Like superscript, subscript has no standard markdown syntax and requires either extended markdown or raw HTML.
Supported in Pandoc, Obsidian, and extended parsers.
Works on any platform that permits HTML in markdown.
| Platform | Supported | Notes |
|---|---|---|
| Obsidian | Yes | Tilde ~ syntax supported |
| GitHub | Partial | HTML <sub> works; ~ syntax does not |
| GitLab | Partial | HTML <sub> works |
| Discord | No | — |
| Notion | No | — |
| Slack | No | — |
H~2O
H~2~O
Tilde syntax requires a closing tilde. An unclosed ~ renders literally on most parsers.
H<sub>2</sub>O and CO<sub>2</sub> are universally understood by markdown parsers that allow HTML.
Everything you need to know.
Use HTML subscript: H<sub>2</sub>O, CO<sub>2</sub>. For platforms supporting extended markdown, use H~2~O.
Superscript text appears above the normal line of text at a smaller size, commonly used for exponents (x²), ordinals (1st), and footnote numbers. Markdown has no standard superscript syntax — platforms use either caret (^) notation or raw HTML.
Strikethrough in markdown is created by wrapping text with double tildes (~~). It renders as crossed-out text and is commonly used to show deleted content, corrections, or completed tasks.
Math expressions in markdown use LaTeX syntax wrapped in dollar sign delimiters. Inline math uses single dollar signs ($x^2$) and display math uses double dollar signs ($$). GitHub added native math rendering in 2022 using MathJax. Obsidian and Jupyter notebooks also support LaTeX math.
Paste your markdown and see subscript rendered instantly with professional themes.