All guides

Superscript and subscript in LaTeX

Updated:

A superscript (power) is written with ^ and a subscript with _. If the index has more than one character, wrap it in braces; otherwise only the first character ends up in the index.

Power and index

x_1^2 + x_2^2
x12+x22x_1^2 + x_2^2

The order of ^ and _ does not matter: x_1^2 and x^2_1 give the same result. LaTeX stacks both indices above each other on the same letter.

Copying this from handwritten notes? Snap a photo of the page and CamteX turns the formulas into LaTeX. Try it free

Multi-character index

a_{n+1} = 2^{10}
an+1=210a_{n+1} = 2^{10}

The braces mark the whole content of the index. Without them a_n+1 gives a with subscript n followed by an ordinary +1, which changes the meaning.

Text subscript

E_{\text{kin}}
EkinE_{\text{kin}}

\text sets the subscript upright, like ordinary text. That matters because kin is an abbreviation of a word, not a product of three variables.

Power of a power

e^{x^2}
ex2e^{x^2}

Indices can be nested, and each level is smaller than the one before. With three or more levels the formula gets hard to read; write \exp(x^2) instead.

Double index

a_{ij} \quad a_{i,j} \quad a_{1,12}
aijai,ja1,12a_{ij} \quad a_{i,j} \quad a_{1,12}

With two one-letter indices a_{ij} is enough. A comma removes ambiguity once numbers appear: a_{112} could mean row 11 or row 1.

Indices on the left

{}^{14}_{6}\mathrm{C}
614C{}^{14}_{6}\mathrm{C}

The empty group {} gives the indices a base, so they land to the left of the symbol. This is how isotopes are written; for chemical formulas the mhchem package is more convenient.

Powers of 10 and negative exponents

c = 3 \cdot 10^{8}\,\mathrm{m/s}, \quad 10^{-3}, \quad x^{-1/2}
c=3⋅108 m/s,10−3,x−1/2c = 3 \cdot 10^{8}\,\mathrm{m/s}, \quad 10^{-3}, \quad x^{-1/2}

A minus sign counts as a character, so 10^-3 puts only the minus in the exponent. In a lab report with many such numbers, \num{3e8} from siunitx writes the power of 10 for you.

Superscript and subscript in normal text

1\textsuperscript{st} place, H\textsubscript{2}O
1st place, H2O1^{\text{st}}\text{ place, H}_{2}\text{O}

Outside math mode ^ and _ are errors. \textsuperscript and \textsubscript keep the letters upright in the font of the paragraph, while $^{st}$ would set them in math italics.

Common mistakes

See also

Don't want to memorize commands?

Draw a formula or paste a screenshot, and CamteX turns it into ready LaTeX.

Try it free