Skip to main content
Master LaTeX subscript and superscript notation for mathematical expressions, scientific notation, and technical documentation. Whether you’re writing research papers, chemical formulas, tensors, or complex equations, this comprehensive guide covers everything from basic subscript syntax to advanced techniques for professional mathematical typesetting.
Quick start: Use _ for subscripts and ^ for superscripts. For multiple characters, enclose in braces: x_{12} and x^{2n}.Prerequisites: Basic LaTeX knowledge. For math mode basics, see Mathematical Expressions.Last updated: January 2026 | Reading time: 12 min | Difficulty: Beginner to Intermediate

What You’ll Learn

  • ✅ Basic LaTeX subscript and superscript syntax for mathematical notation
  • ✅ Multiple character subscripts and compound superscript expressions
  • ✅ Special cases (limits, operators, tensor notation)
  • ✅ Chemical formula subscript notation and isotopes
  • ✅ Advanced subscript positioning and formatting techniques
  • ✅ Common subscript errors and how to fix them
  • ✅ Best practices for readable mathematical notation

Frequently Asked Questions

In LaTeX, subscripts are notations placed below the baseline using the underscore character (_), commonly used for indices and chemical formulas. Superscripts are placed above the baseline using the caret character (^), typically for exponents and powers. Both are essential for mathematical and scientific notation in professional documents.Quick Example:
  • Subscript: x_1 renders as x₁
  • Superscript: x^2 renders as x²
Always use braces {} to group multiple characters in a LaTeX subscript or superscript. Without braces, only the first character becomes a subscript.Correct subscript syntax:
x_{12}      % Both 1 and 2 are subscript
x_{n+1}     % Entire expression is subscript
Wrong syntax:
x_12        % Only 1 is subscript (renders as x₁2)
This is one of the most common subscript errors in LaTeX.
The “Double subscript” error occurs when you try to apply two subscripts to the same variable without proper grouping:
x_a_b       % ERROR: Double subscript
Solutions:
  1. Use nested braces if one subscript depends on another:
x_{a_b}     % Correct: a has subscript b, all subscript to x
  1. Or separate them with an empty group:
x_a{}_{b}   % Correct: separate subscripts
For chemical formula subscript notation, enclose the formula in \mathrm{} and use subscripts for atom counts:
$\mathrm{H_2O}$         % Water
$\mathrm{SO_4^{2-}}$    % Sulfate ion
$^{14}\mathrm{C}$       % Carbon-14 isotope
For better chemistry support, use the mhchem package:
\usepackage{mhchem}
\ce{H2O}                % Simpler syntax
\ce{SO4^{2-}}           % Cleaner appearance
Tensor notation typically places superscripts before subscripts for contravariant and covariant indices:
$T^{\mu\nu}_{\rho\sigma}$   % Standard tensor notation
$R^{\alpha}_{\beta\gamma\delta}$    % Riemann curvature tensor
$g_{\mu\nu}$                        % Metric tensor
The tensor package can simplify pre-superscripts and pre-subscripts in tensor notation.
Yes! Use \textsubscript{} and \textsuperscript{} commands for text mode subscript notation:
H\textsubscript{2}O is water.
E = mc\textsuperscript{2} is Einstein's equation.
Alternatively, use math mode notation within text:
H$_2$O is water.
Avoid excessive subscript nesting beyond 2-3 levels, as it becomes hard to read:Acceptable nesting:
$x_{i_j}$       % OK: two levels
Problematic nesting:
$x_{i_{j_{k}}}$ % Difficult to read and maintain
Best practice: For complex notation, break expressions into parts for clarity.
Consistency guidelines for academic subscript notation:
  1. Index naming: Use consistent single letters (i, j, k) throughout
  2. Coordinate systems: Stick to one notation style consistently
  3. Vector notation: Use either subscripts or superscripts consistently
  4. Summation indices: Follow Einstein summation convention in physics
  5. Semantic meaning: Choose meaningful indices: v_x instead of v_1 for x-component

Basic Syntax

Subscripts (Indices)

\documentclass{article}
\usepackage{amsmath}
\begin{document}

% Single character subscript
$x_1$, $x_2$, $x_n$

% Multiple character subscript (requires braces)
$x_{12}$, $x_{n+1}$, $x_{max}$

% Variables with subscripts
$a_i$, $b_j$, $c_{ij}$

% Greek letters with subscripts
$\alpha_1$, $\beta_{n}$, $\gamma_{i,j}$

\end{document}

Rendered Output

Single character: x1x_1, x2x_2, xnx_nMultiple characters: x12x_{12}, xn+1x_{n+1}, xmaxx_{max}Variables: aia_i, bjb_j, cijc_{ij}Greek letters: α1\alpha_1, βn\beta_{n}, γi,j\gamma_{i,j}

Superscripts (Exponents)

\documentclass{article}
\usepackage{amsmath}
\begin{document}

% Single character superscript
$x^2$, $x^n$, $x^*$

% Multiple character superscript (requires braces)
$x^{10}$, $x^{2n}$, $x^{n+1}$

% Common exponents
$e^x$, $2^n$, $10^{-3}$

% Special notations
$x^{\prime}$, $x^{\dagger}$, $x^{\ast}$

\end{document}

Rendered Output

Single character: x2x^2, xnx^n, xx^*Multiple characters: x10x^{10}, x2nx^{2n}, xn+1x^{n+1}Common exponents: exe^x, 2n2^n, 10310^{-3}Special notations: xx^{\prime}, xx^{\dagger}, xx^{\ast}

Important Rule: Braces for Multiple Characters

Critical: Without braces, only the first character after _ or ^ becomes sub/superscript:
  • x_12 renders as x₁2 (only 1 is subscript)
  • x_{12} renders as x₁₂ (both 1 and 2 are subscript)

Combined Subscripts and Superscripts

Basic Combinations

\documentclass{article}
\usepackage{amsmath}
\begin{document}

% Both subscript and superscript
$x_1^2$, $a_n^m$, $x_i^{j+1}$

% Order doesn't matter
$x_1^2 = x^2_1$

% Complex combinations
$x_{n+1}^{2m}$, $a_{ij}^{kl}$

% With operators
$\sum_{i=1}^n$, $\int_0^{\infty}$

% Tensor notation
$T_{\mu\nu}^{\rho\sigma}$

\end{document}

Rendered Output

Both subscript and superscript: x12x_1^2, anma_n^m, xij+1x_i^{j+1}Order doesn’t matter: x12=x12x_1^2 = x^2_1Complex combinations: xn+12mx_{n+1}^{2m}, aijkla_{ij}^{kl}With operators: i=1n\displaystyle\sum_{i=1}^n, 0\displaystyle\int_0^{\infty}Tensor notation: TμνρσT_{\mu\nu}^{\rho\sigma}

Nested Subscripts and Superscripts

\documentclass{article}
\usepackage{amsmath}
\begin{document}

% Nested superscripts
$x^{2^n}$, $e^{x^2}$, $2^{2^{2^2}}$

% Nested subscripts
$x_{i_j}$, $a_{n_{k+1}}$

% Mixed nesting
$x_i^{j^k}$, $a_{m_n}^{p^q}$

% Using additional braces for clarity
${(x^2)}^3 = x^6$

% Tower notation
$2^{2^{2^{\cdot^{\cdot^{\cdot}}}}}$

\end{document}

Rendered Output

Nested superscripts: x2nx^{2^n}, ex2e^{x^2}, 22222^{2^{2^2}}Nested subscripts: xijx_{i_j}, ank+1a_{n_{k+1}}Mixed nesting: xijkx_i^{j^k}, amnpqa_{m_n}^{p^q}With braces: (x2)3=x6{(x^2)}^3 = x^6Tower notation: 2222^{2^{2^{\cdot^{\cdot^{\cdot}}}}}

Special Use Cases

Limits and Operators

\documentclass{article}
\usepackage{amsmath}
\begin{document}

% Inline limits
$\lim_{x \to 0} f(x)$

% Display style limits
\[\lim_{x \to \infty} \frac{1}{x} = 0\]

% Summation
\[\sum_{i=1}^{n} i = \frac{n(n+1)}{2}\]

% Product
\[\prod_{k=1}^{n} k = n!\]

% Integration
\[\int_0^1 x^2 \, dx = \frac{1}{3}\]

% Multiple limits
\[\lim_{\substack{x \to 0 \\ y \to 0}} f(x,y)\]

\end{document}

Rendered Output

Inline limit: limx0f(x)\lim_{x \to 0} f(x)Display style limit: limx1x=0\lim_{x \to \infty} \frac{1}{x} = 0Summation: i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2}Product: k=1nk=n!\prod_{k=1}^{n} k = n!Integration: 01x2dx=13\int_0^1 x^2 \, dx = \frac{1}{3}Multiple limits: limx0y0f(x,y)\lim_{\substack{x \to 0 \\ y \to 0}} f(x,y)

Chemical Formulas

\documentclass{article}
\usepackage{amsmath}
\usepackage{mhchem} % Better chemistry support
\begin{document}

% Basic chemical formulas
$\mathrm{H_2O}$, $\mathrm{CO_2}$, $\mathrm{H_2SO_4}$

% Isotopes
$^{14}\mathrm{C}$, $^{235}\mathrm{U}$, $^2\mathrm{H}$

% Ions
$\mathrm{Na^+}$, $\mathrm{Cl^-}$, $\mathrm{SO_4^{2-}}$

% With mhchem package (recommended)
\ce{H2O}, \ce{CO2}, \ce{H2SO4}
\ce{^{14}C}, \ce{Na+}, \ce{SO4^{2-}}

% Chemical equations
\ce{2H2 + O2 -> 2H2O}

\end{document}

Rendered Output

Basic chemical formulas: H2O\mathrm{H_2O}, CO2\mathrm{CO_2}, H2SO4\mathrm{H_2SO_4}Isotopes: 14C^{14}\mathrm{C}, 235U^{235}\mathrm{U}, 2H^{2}\mathrm{H}Ions: Na+\mathrm{Na^+}, Cl\mathrm{Cl^-}, SO42\mathrm{SO_4^{2-}}Chemical equation: 2H2+O22H2O2\mathrm{H_2} + \mathrm{O_2} \rightarrow 2\mathrm{H_2O}

Physics and Engineering Notation

\documentclass{article}
\usepackage{amsmath}
\usepackage{tensor} % For tensor notation
\begin{document}

% Vector components
$\vec{v} = v_x\hat{i} + v_y\hat{j} + v_z\hat{k}$

% Derivatives
$\frac{d^2y}{dx^2}$, $\frac{\partial^2 f}{\partial x^2}$

% Tensors
$g_{\mu\nu}$, $R^{\alpha}_{\beta\gamma\delta}$

% Four-vectors
$x^\mu = (ct, x, y, z)$

% Christoffel symbols
$\Gamma^{\lambda}_{\mu\nu}$

% Units
$10^{-9}\,\mathrm{m}$, $3.0 \times 10^8\,\mathrm{m/s}$

\end{document}

Rendered Output

Vector components: v=vxi^+vyj^+vzk^\vec{v} = v_x\hat{i} + v_y\hat{j} + v_z\hat{k}Derivatives: d2ydx2\frac{d^2y}{dx^2}, 2fx2\frac{\partial^2 f}{\partial x^2}Tensors: gμνg_{\mu\nu}, RβγδαR^{\alpha}_{\beta\gamma\delta}Four-vectors: xμ=(ct,x,y,z)x^\mu = (ct, x, y, z)Christoffel symbols: Γμνλ\Gamma^{\lambda}_{\mu\nu}Units: 109m10^{-9}\,\mathrm{m}, 3.0×108m/s3.0 \times 10^8\,\mathrm{m/s}

Advanced Techniques

Primes and Multiple Primes

\documentclass{article}
\usepackage{amsmath}
\begin{document}

% Single prime
$f'(x)$, $y'$

% Multiple primes
$f''(x)$, $f'''(x)$

% Alternative notation
$f^{\prime}(x)$, $f^{\prime\prime}(x)$

% With subscripts
$x'_1$, $x''_n$

% Prime on subscript
$x_{n'}$, $x_{n''}$

\end{document}

Rendered Output

Single prime: f(x)f'(x), yy'Multiple primes: f(x)f''(x), f(x)f'''(x)Alternative notation: f(x)f^{\prime}(x), f(x)f^{\prime\prime}(x)With subscripts: x1x'_1, xnx''_nPrime on subscript: xnx_{n'}, xnx_{n''}

Positioning and Spacing

\documentclass{article}
\usepackage{amsmath}
\begin{document}

% Pre-subscripts and superscripts
${}_a^b X_c^d$

% Tensor notation with prescript package
\usepackage{tensor}
\tensor[^a_b]{X}{_c^d}

% Manual spacing adjustments
$x_{\!n}$ % negative thin space
$x_{\,n}$ % thin space
$x_{\:n}$ % medium space
$x_{\;n}$ % thick space

% Phantom subscripts for alignment
\begin{align}
x_1 &= a \\
x_{\phantom{1}2} &= b
\end{align}

\end{document}

Accents with Sub/Superscripts

\documentclass{article}
\usepackage{amsmath}
\begin{document}

% Accents with subscripts
$\hat{x}_i$, $\tilde{y}_n$, $\bar{z}_k$

% Accents with superscripts
$\hat{x}^2$, $\vec{v}^T$, $\dot{x}^n$

% Combined
$\hat{x}_i^2$, $\tilde{\phi}_{nm}^{kl}$

% Wide accents
$\widehat{xyz}_1^2$, $\widetilde{ABC}_{ij}$

\end{document}

Rendered Output

Accents with subscripts: x^i\hat{x}_i, y~n\tilde{y}_n, zˉk\bar{z}_kAccents with superscripts: x^2\hat{x}^2, vT\vec{v}^T, x˙n\dot{x}^nCombined: x^i2\hat{x}_i^2, ϕ~nmkl\tilde{\phi}_{nm}^{kl}Wide accents: xyz^12\widehat{xyz}_1^2, ABC~ij\widetilde{ABC}_{ij}

Text Mode Subscripts and Superscripts

\documentclass{article}
\usepackage{fixltx2e} % For \textsubscript
\begin{document}

% In text mode
H\textsubscript{2}O is water.
E = mc\textsuperscript{2} is Einstein's equation.

% Or use math mode
H$_2$O is water.
E = mc$^2$ is Einstein's equation.

% Ordinals
1\textsuperscript{st}, 2\textsuperscript{nd}, 3\textsuperscript{rd}

% Footnote markers
Text\textsuperscript{a}, Reference\textsuperscript{1}

\end{document}

Rendered Output

In text mode: H2_2O is water. E = mc2^2 is Einstein’s equation.Ordinals: 1st^{\text{st}}, 2nd^{\text{nd}}, 3rd^{\text{rd}}Footnote markers: Texta^{\text{a}}, Reference1^1

Common Errors and Solutions

Problem: x_a_b causes “Double subscript” error.Solution: Use braces to clarify structure:
x_{a_b}    % a with subscript b, all subscript to x
x_a{}_{b}  % separate subscripts a and b
Problem: x_12 shows as x₁2 instead of x₁₂.Solution: Always use braces for multiple characters:
x_{12}     % Correct
x_12       % Wrong
Problem: Limits appear cramped in inline math.Solution: Use display style or \limits:
$\lim\limits_{x \to 0}$     % Forces display style
\[\lim_{x \to 0}\]          % Use display math
Problem: x'^2 doesn’t work as expected.Solution: Use proper grouping:
{x'}^2     % Correct
x'^2       % May cause issues
x^{\prime 2}  % Alternative

Best Practices

1. Readability Guidelines

Good Practices:
  • Use meaningful subscripts: v_x not v_1 for x-component
  • Avoid deep nesting: x_{i_j} is okay, deeper is confusing
  • Be consistent: If using i,j,k for indices, stick to it
  • Use semantic notation: \max not max
Poor Practices to Avoid:
  • Overusing sub/superscripts: x_{a_{b_{c_{d}}}}
  • Mixing notation styles in same document
  • Using subscripts for non-mathematical text
  • Forgetting braces: x_min instead of x_{min}

2. Consistency Rules

  • Indices: Use consistent letters (i, j, k or m, n, p)
  • Coordinates: Be consistent (x, y, z or r, θ, φ)
  • Time derivatives: Choose notation and stick to it (ẋ or dx/dt)
  • Vector components: Consistent notation (subscripts or superscripts)

3. Special Notation Standards

% Tensors - superscripts before subscripts
$T^{\mu\nu}_{\rho\sigma}$  % Correct
$T_{\rho\sigma}^{\mu\nu}$  % Less standard

% Derivatives - use consistent notation
$\frac{\partial^2 f}{\partial x^2}$  % Standard
$f_{xx}$                              % Alternative

% Units - use upright text
$10^{-3}\,\mathrm{m}$     % Correct
$10^{-3}\,m$              % Wrong (italic m)

4. Accessibility Considerations

  • Avoid excessive nesting that’s hard to read
  • Use \text{} for words in subscripts: x_{\text{max}}
  • Consider alternative notations for complex expressions
  • Break very complex expressions into parts

Quick Reference Card

CommandResultDescription
x_1x1x_1Single subscript
x^2x2x^2Single superscript
x_{12}x12x_{12}Multiple character subscript
x^{2n}x2nx^{2n}Multiple character superscript
x_i^jxijx_i^jCombined sub/superscript
\sum_{i=1}^ni=1n\displaystyle\sum_{i=1}^nSummation limits
\lim_{x \to 0}limx0\displaystyle\lim_{x \to 0}Limit notation
f'(x)f(x)f'(x)Prime notation
{}_{a}^{b}X_{c}^{d}abXcd{}_a^b X_c^dPre-superscript/subscript
\textsubscript{2}H2_2OText mode subscript
^{14}\mathrm{C}14C^{14}\mathrm{C}Isotope notation
T^{\mu\nu}_{\rho}TρμνT^{\mu\nu}_{\rho}Tensor notation

Further Reading & References

For authoritative documentation on LaTeX subscript and superscript handling:
  • amsmath Package Documentation - The standard package for advanced mathematical notation, including enhanced subscript positioning
  • The LaTeX Companion (3rd Edition) - Comprehensive reference for mathematical typesetting best practices
  • ISO 80000-2 - International standard for mathematical notation in scientific documents
LaTeX Cloud Studio tip: Use our equation preview feature to instantly see how your subscripts and superscripts render. No compilation needed!