<sub> and <sup>
The <sub> and <sup> elements sets inline text to be displayed as subscript or superscript for solely typographical reasons.
Overview
The <sub> and <sup> elements sets inline text to be displayed as subscript or superscript for solely typographical reasons.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 1 | 12 | 1 | ≤4 | 18 | ≤3.2 | |
| Other | ||||||
| The HTML element specifies inline text which is to be displayed as superscript for solely typographical reasons. Superscripts are usually rendered with a raised baseline using smaller text. | 1 | 12 | 1 | ≤4 | 18 | ≤3.2 |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
HTML
<p>Chemical formula for water: H<sub>₂</sub>O</p>
<p>Formula for area: A = πr²</p>
<p>Annotation text<sup><a href="#note1">[1]</a></sup></p> Live demo
Superscript / Subscriptcharacter
Sub(subscript) and sup(superscript) in number notation or annotation representation.
PreviewFullscreen
Use cases
Using <sub> and <sup>
The <sub> and <sup> elements sets inline text to be displayed as subscript or superscript for solely typographical reasons.
Cautions
- May not be supported in older browsers.
Accessibility
- Verify how this element is announced by screen readers.
Related links
Powered by web-features