: The Subscript element - HTML | MDN
Skip to search
: The Subscript element
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
See full compatibility
Report feedback
The
HTML
element specifies inline text which should be displayed as subscript for solely typographical reasons. Subscripts are typically rendered with a lowered baseline using smaller text.
Try it
Almost every developer's favorite molecule is
C8H10N4O2, also known as
"caffeine."
p {
font:
1rem "Fira Sans",
sans-serif;
Attributes
This element only includes the
global attributes
Usage notes
The
element should be used only for typographical reasons—that is, to change the position of the text to comply with typographical conventions or standards, rather than solely for presentation or appearance purposes.
For example, using
to style the name of a company which uses altered baselines in their
wordmark
would not be appropriate; instead, CSS should be used. For example, you could use the
vertical-align
property with a declaration like
vertical-align: sub
or, to more precisely control the baseline shift,
vertical-align: -25%
Appropriate use cases for
include (but aren't necessarily limited to):
Marking up footnote numbers. See
Footnote numbers
for an example.
Marking up the subscript in mathematical variable numbers (although you may also consider using a
MathML
formula for this). See
Variable subscripts
Denoting the number of atoms of a given element within a chemical formula (such as every developer's best friend, C
10
, otherwise known as "caffeine"). See
Chemical formulas
Examples
Footnote numbers
Traditional footnotes are denoted using numbers which are rendered in subscript. This is a common use case for
html
According to the computations by Nakamura, Johnson, and Mason1 this
will result in the complete annihilation of both particles.
Result
Variable subscripts
In mathematics, families of variables related to the same concept (such as distances along the same axis) are represented using the same variable name with a subscript following. For example:
html
The horizontal coordinates' positions along the X-axis are represented as
x1 … xn.
Result
Chemical formulas
When writing a chemical formula, such as H
O, the number of atoms of a given element within the described molecule is represented using a subscripted number; in the case of water, the subscripted "2" indicates that there are two atoms of hydrogen in the molecule.
Another example:
html
Almost every developer's favorite molecule is
C8H10N4O2, which is commonly known
as "caffeine."
Result
Technical summary
Content categories
Flow content
phrasing content
, palpable content.
Permitted content
Phrasing content
Tag omission
None, both the starting and ending tag are mandatory.
Permitted parents
Any element that accepts
phrasing content
Implicit ARIA role
subscript
Permitted ARIA roles
Any
DOM interface
HTMLElement
Specifications
Specification
HTML
# the-sub-and-sup-elements
Browser compatibility
See also
The
HTML element that produces superscript. Note that you cannot use
sup
and
sub
both at the same time: you need to use
MathML
to produce both a superscript directly above a subscript next to the chemical symbol of an element, representing its atomic number and its nuclear number.
The
, and
MathML elements.
The CSS
vertical-align
property.
Help improve MDN
Learn how to contribute
This page was last modified on
Oct 26, 2025
by
MDN contributors
View this page on GitHub
Report a problem with this content
US