How to Use Superscript and Subscript in LaTeX 📐
If you're writing mathematical equations, chemical formulas, or footnotes in LaTeX, you'll need to know how to format superscript (raised text) and subscript (lowered text). These aren't decorative—they're essential for expressing everything from exponents and indices to chemical compounds and variable names. This guide walks you through the syntax, common use cases, and practical tips for getting them right.
What Superscript and Subscript Actually Do
Superscript is text positioned above the baseline, typically smaller than the surrounding text. In mathematics and science, superscript commonly represents:
- Exponents (e.g., x²)
- Powers (e.g., 10³)
- Footnote markers or citations
- Mathematical operations (e.g., derivatives)
Subscript is text positioned below the baseline, also typically smaller. It's used for:
- Indices or sequence positions (e.g., x₁, x₂)
- Chemical notation (e.g., H₂O)
- Variable labeling (e.g., aₙ for the nth term)
- Distinguishing similar variables (e.g., P_input vs. P_output)
The key difference is positioning—superscript goes up, subscript goes down—and both serve to clarify mathematical meaning without cluttering your main text.
Basic LaTeX Syntax: The Caret and Underscore
LaTeX uses two simple characters to control vertical positioning:
- ^ (caret) creates superscript
- _ (underscore) creates subscript
Single Characters
For a single character, place the caret or underscore directly before it:
Multiple Characters
If you need more than one character in the superscript or subscript, wrap it in curly braces {}:
This is one of the most common mistakes: forgetting the braces when you have multiple characters. Without them, LaTeX only applies the formatting to the first character, leaving the rest in normal position.
Combining Superscript and Subscript
You can use both on the same base element. The order doesn't matter—LaTeX handles the positioning automatically:
When both are present, they appear on opposite sides of the base character, creating clear, readable notation without ambiguity.
Practical Examples in Different Contexts
Mathematical Equations
Chemical Notation
Physics and Engineering
Sequences and Series
Using Superscript and Subscript in Text Mode vs. Math Mode
LaTeX has two main modes: text mode (normal writing) and math mode (for equations). Superscript and subscript work differently in each.
In Math Mode (Most Common)
When you're inside an equation environment or between $...$ or \[...\], use ^ and _ directly:
