Skip to content
All referenceText Formatting

Markdown Subscript

How to write subscript text in markdown using tilde syntax or HTML. Syntax, examples, and platform support.

What is markdown subscript?

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.

Syntax

Tilde syntax (extended)

Supported in Pandoc, Obsidian, and extended parsers.

Result
H2O

HTML (universal)

Works on any platform that permits HTML in markdown.

Result
H2O

Platform support

PlatformSupportedNotes
ObsidianYesTilde ~ syntax supported
GitHubPartialHTML <sub> works; ~ syntax does not
GitLabPartialHTML <sub> works
DiscordNo
NotionNo
SlackNo

Common mistakes

Wrong
H~2O
Right
H~2~O

Tilde syntax requires a closing tilde. An unclosed ~ renders literally on most parsers.

Tips for subscript

1Use HTML for chemistry and math

H<sub>2</sub>O and CO<sub>2</sub> are universally understood by markdown parsers that allow HTML.

Frequently asked questions

Everything you need to know.

1

How do I write chemical formulas in markdown?

Use HTML subscript: H<sub>2</sub>O, CO<sub>2</sub>. For platforms supporting extended markdown, use H~2~O.

Related elements

Try it in the editor

Paste your markdown and see subscript rendered instantly with professional themes.