H~2~O (Chemical formula)
E = mc^2^ (Mathematical exponent)
10<sup>th</sup> anniversarySubscript and superscript formatting are indispensable for writing chemistry formulas, mathematical exponents, ordinal numbers, physics equations, and trademark notices.
While the original Markdown specification omitted dedicated shorthand for subscript and superscript, modern extended Markdown engines (such as Pandoc, MultiMarkdown, and Kramdown) and knowledge tools like Oyma support clean delimiter syntax alongside standard HTML tags.
Extended Markdown syntax
In Extended Markdown, single tildes (~) define subscript, and single carets (^) define superscript:
Subscript syntax: ~text~
Water is composed of hydrogen and oxygen: H~2~O.
Carbon dioxide emissions: CO~2~.
Glucose chemical formula: C~6~H~12~O~6~.
In the rendered view, the text between the tildes drops below the baseline: H₂O, CO₂, C₆H₁₂O₆.
Superscript syntax: ^text^
Mass-energy equivalence formula: E = mc^2^.
The Pythagorean theorem states: a^2^ + b^2^ = c^2^.
Celebrating our 10^th^ anniversary.
Registered trademark: Acme^®^ Corp.
In the rendered view, the text between carets raises above the baseline: E = mc², a² + b² = c².
Universal HTML syntax: <sub> and <sup>
Because CommonMark preserves valid HTML markup, standard HTML <sub> and <sup> tags are the most widely compatible method across all Markdown parsers:
<!-- Subscript using HTML -->
H<sub>2</sub>O is liquid water.
<!-- Superscript using HTML -->
E = mc<sup>2</sup> is Einstein's famous equation.
Celebrating our 15<sup>th</sup> annual summit.
HTML tags are guaranteed to work in GitHub READMEs, static site generators, documentation engines, and email clients where extended Markdown tilde/caret syntax might not be enabled.
When to use LaTeX math instead
If you are writing complex scientific or mathematical formulas with multiple levels of nested indices, LaTeX inline math ($...$) is cleaner and more powerful:
<!-- LaTeX inline math -->
The limit is $\lim_{x \to \infty} \frac{1}{x} = 0$.
The matrix element is denoted by $A_{i,j}^{(k)}$.
For comprehensive mathematical formula workflows, see our Math & KaTeX reference.
Best practices for subscripts and superscripts
- Chemical notation: Use
H~2~OorH<sub>2</sub>Ofor simple chemical compounds. - Mathematical exponents: Use LaTeX math (
$x^2$) for complex math, or carets (x^2^) for simple exponents in text. - Ordinal dates: While
10^th^is valid, modern typographic style manuals (including the Chicago Manual of Style) recommend writing standard ordinals without superscripting (e.g., “October 9th, 2026”) for cleaner screen legibility.
Subscripts and superscripts in Oyma
In Oyma on macOS:
- Both
~sub~/^sup^and HTML<sub>/<sup>tags render smoothly in our live-preview editor. - Typography scales elegantly to maintain clean line heights without awkward vertical shifting.
- Raw files remain 100% portable plain text on your Mac disk.
Frequently asked questions
- What is the Markdown syntax for subscript and superscript?
- In Extended Markdown and Pandoc, subscript is enclosed within single tildes (`H~2~O`) and superscript is enclosed within single carets (`x^2^` or `x^2`). Standard HTML `` and `` tags are universally supported across all Markdown engines.
- Does standard CommonMark include subscript and superscript syntax?
- No. Core CommonMark does not specify dedicated punctuation for subscript or superscript. Writers in vanilla CommonMark environments use standard HTML `` and `` tags (`H2O`).
- Can I use LaTeX math for exponents and subscripts instead?
- Yes. For mathematical and scientific formulas, LaTeX inline math (`$H_2O$` or `$x^2$`) rendered via KaTeX is often preferred because it offers precise typographic control.
- How does Oyma render subscript and superscript?
- Oyma supports both extended caret/tilde syntax and standard HTML tags, rendering characters with scaled typographic baselines in the live-preview editor.
Experience Subscript & Superscript with zero lock-in.
Write Extended Markdown notes directly on your Mac with native live preview and sovereign local storage.