HTML Subscript Generator
Generate a <sub> subscript element for chemical formulas, footnote markers, and mathematical notation — and copy the HTML with live preview.
Last updated: May 21, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is HTML Subscript Generator?
The HTML `<sub>` element renders its content as a subscript — text positioned below the baseline at a smaller size. It is the correct semantic element for typographical subscripts that carry meaning, such as:
- Chemical formulas: H`<sub>`2`</sub>`O (water), CO`<sub>`2`</sub>` (carbon dioxide) - Mathematical notation: log`<sub>`n`</sub>` (logarithm base n) - Footnote or endnote markers in some languages
For purely decorative vertical text positioning without semantic meaning, use CSS `vertical-align: sub` instead.
How to Use HTML Subscript Generator
Enter the subscript text (e.g. "2" for H₂O)
Optionally add id, class, or title attributes
Copy the generated HTML and insert it within surrounding text
Common Use Cases
- Science content authors writing chemical formula pages.
- Educators marking up mathematical expressions with subscript notation.
- Developers generating footnote reference markers in article templates.
Example Input and Output
A subscript "2" for the water molecule formula.
Text: 2<sub>2</sub>Privacy
All HTML generation runs in your browser. No data is sent to any server.

