> ## Documentation Index
> Fetch the complete documentation index at: https://resources.latex-cloud-studio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LaTeX Subscript and Superscript: _, ^, Braces, and Common Errors

> Use `_` for a LaTeX subscript and `^` for a superscript. Learn braces for multi-character indices, chemistry examples, and common fixes.

To write a subscript in LaTeX, use `_` in math mode: `x_1`. To write a superscript, use `^`: `x^2`. When the subscript or superscript contains more than one character, wrap it in braces, as in `x_{12}` or `x^{2n}`. This guide starts with the basic subscript syntax most people search for, then covers superscripts, chemistry notation, tensors, and the errors that usually break equations.

<Info>
  **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](/learn/latex/mathematics/mathematical-expressions).

  **Last updated**: April 2026 | **Reading time**: 12 min | **Difficulty**: Beginner to Intermediate
</Info>

## 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

<Accordion title="What is the difference between subscripts and superscripts in LaTeX?">
  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²
</Accordion>

<Accordion title="How do I write multiple character subscripts in LaTeX?">
  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:**

  ```latex theme={null}
  x_{12}      % Both 1 and 2 are subscript
  x_{n+1}     % Entire expression is subscript
  ```

  **Wrong syntax:**

  ```latex theme={null}
  x_12        % Only 1 is subscript (renders as x₁2)
  ```

  This is one of the most common subscript errors in LaTeX.
</Accordion>

<Accordion title="Why do I get a 'Double subscript' error in LaTeX?">
  The "Double subscript" error occurs when you try to apply two subscripts to the same variable without proper grouping:

  ```latex theme={null}
  x_a_b       % ERROR: Double subscript
  ```

  **Solutions:**

  1. Use nested braces if one subscript depends on another:

  ```latex theme={null}
  x_{a_b}     % Correct: a has subscript b, all subscript to x
  ```

  2. Or separate them with an empty group:

  ```latex theme={null}
  x_a{}_{b}   % Correct: separate subscripts
  ```
</Accordion>

<Accordion title="How do I use subscripts in chemical formulas?">
  For chemical formula subscript notation, enclose the formula in `\mathrm{}` and use subscripts for atom counts:

  ```latex theme={null}
  $\mathrm{H_2O}$         % Water
  $\mathrm{SO_4^{2-}}$    % Sulfate ion
  $^{14}\mathrm{C}$       % Carbon-14 isotope
  ```

  For better chemistry support, use the `mhchem` package:

  ```latex theme={null}
  \usepackage{mhchem}
  \ce{H2O}                % Simpler syntax
  \ce{SO4^{2-}}           % Cleaner appearance
  ```
</Accordion>

<Accordion title="What's the correct syntax for tensor notation subscripts?">
  Tensor notation typically places superscripts before subscripts for contravariant and covariant indices:

  ```latex theme={null}
  $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.
</Accordion>

<Accordion title="Can I use subscripts in LaTeX text mode (outside of equations)?">
  Yes! Use `\textsubscript{}` and `\textsuperscript{}` commands for text mode subscript notation:

  ```latex theme={null}
  H\textsubscript{2}O is water.
  E = mc\textsuperscript{2} is Einstein's equation.
  ```

  Alternatively, use math mode notation within text:

  ```latex theme={null}
  H$_2$O is water.
  ```
</Accordion>

<Accordion title="How do I avoid deeply nested subscript errors?">
  Avoid excessive subscript nesting beyond 2-3 levels, as it becomes hard to read:

  **Acceptable nesting:**

  ```latex theme={null}
  $x_{i_j}$       % OK: two levels
  ```

  **Problematic nesting:**

  ```latex theme={null}
  $x_{i_{j_{k}}}$ % Difficult to read and maintain
  ```

  **Best practice:** For complex notation, break expressions into parts for clarity.
</Accordion>

<Accordion title="What's the best practice for mathematical indices in research papers?">
  **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
</Accordion>

## Basic Syntax

### Subscripts (Indices)

<CodeGroup>
  ```latex basic-subscripts.tex theme={null}
  \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}
  ```
</CodeGroup>

<Card title="Rendered Output" icon="eye">
  **Single character:** $x_1$, $x_2$, $x_n$

  **Multiple characters:** $x_{12}$, $x_{n+1}$, $x_{max}$

  **Variables:** $a_i$, $b_j$, $c_{ij}$

  **Greek letters:** $\alpha_1$, $\beta_{n}$, $\gamma_{i,j}$
</Card>

### Superscripts (Exponents)

<CodeGroup>
  ```latex basic-superscripts.tex theme={null}
  \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}
  ```
</CodeGroup>

<Card title="Rendered Output" icon="eye">
  **Single character:** $x^2$, $x^n$, $x^*$

  **Multiple characters:** $x^{10}$, $x^{2n}$, $x^{n+1}$

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

  **Special notations:** $x^{\prime}$, $x^{\dagger}$, $x^{\ast}$
</Card>

### Important Rule: Braces for Multiple Characters

<Warning>
  **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)
</Warning>

## Combined Subscripts and Superscripts

### Basic Combinations

<CodeGroup>
  ```latex combined-sub-super.tex theme={null}
  \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}
  ```
</CodeGroup>

<Card title="Rendered Output" icon="eye">
  **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:** $\displaystyle\sum_{i=1}^n$, $\displaystyle\int_0^{\infty}$

  **Tensor notation:** $T_{\mu\nu}^{\rho\sigma}$
</Card>

### Nested Subscripts and Superscripts

<CodeGroup>
  ```latex nested-sub-super.tex theme={null}
  \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}
  ```
</CodeGroup>

<Card title="Rendered Output" icon="eye">
  **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}$

  **With braces:** ${(x^2)}^3 = x^6$

  **Tower notation:** $2^{2^{2^{\cdot^{\cdot^{\cdot}}}}}$
</Card>

## Special Use Cases

### Limits and Operators

<CodeGroup>
  ```latex limits-operators.tex theme={null}
  \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}
  ```
</CodeGroup>

<Card title="Rendered Output" icon="eye">
  **Inline limit:** $\lim_{x \to 0} f(x)$

  **Display style limit:** $\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)$
</Card>

### Chemical Formulas

<CodeGroup>
  ```latex chemical-formulas.tex theme={null}
  \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}
  ```
</CodeGroup>

<Card title="Rendered Output" icon="eye">
  **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-}}$

  **Chemical equation:** $2\mathrm{H_2} + \mathrm{O_2} \rightarrow 2\mathrm{H_2O}$
</Card>

### Physics and Engineering Notation

<CodeGroup>
  ```latex physics-notation.tex theme={null}
  \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}
  ```
</CodeGroup>

<Card title="Rendered Output" icon="eye">
  **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}$
</Card>

## Advanced Techniques

### Primes and Multiple Primes

<CodeGroup>
  ```latex primes.tex theme={null}
  \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}
  ```
</CodeGroup>

<Card title="Rendered Output" icon="eye">
  **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''}$
</Card>

### Positioning and Spacing

<CodeGroup>
  ```latex positioning.tex theme={null}
  \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}
  ```
</CodeGroup>

### Accents with Sub/Superscripts

<CodeGroup>
  ```latex accents-sub-super.tex theme={null}
  \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}
  ```
</CodeGroup>

<Card title="Rendered Output" icon="eye">
  **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}$
</Card>

## Text Mode Subscripts and Superscripts

<CodeGroup>
  ```latex text-mode.tex theme={null}
  \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}
  ```
</CodeGroup>

<Card title="Rendered Output" icon="eye">
  **In text mode:** H$_2$O is water. E = mc$^2$ is Einstein's equation.

  **Ordinals:** 1$^{\text{st}}$, 2$^{\text{nd}}$, 3$^{\text{rd}}$

  **Footnote markers:** Text$^{\text{a}}$, Reference$^1$
</Card>

## Common Errors and Solutions

<Accordion title="Error: Double subscript">
  **Problem**: `x_a_b` causes "Double subscript" error.

  **Solution**: Use braces to clarify structure:

  ```latex theme={null}
  x_{a_b}    % a with subscript b, all subscript to x
  x_a{}_{b}  % separate subscripts a and b
  ```
</Accordion>

<Accordion title="Only first character is sub/superscript">
  **Problem**: `x_12` shows as x₁2 instead of x₁₂.

  **Solution**: Always use braces for multiple characters:

  ```latex theme={null}
  x_{12}     % Correct
  x_12       % Wrong
  ```
</Accordion>

<Accordion title="Subscripts in limit are inline">
  **Problem**: Limits appear cramped in inline math.

  **Solution**: Use display style or `\limits`:

  ```latex theme={null}
  $\lim\limits_{x \to 0}$     % Forces display style
  \[\lim_{x \to 0}\]          % Use display math
  ```
</Accordion>

<Accordion title="Prime notation conflicts">
  **Problem**: `x'^2` doesn't work as expected.

  **Solution**: Use proper grouping:

  ```latex theme={null}
  {x'}^2     % Correct
  x'^2       % May cause issues
  x^{\prime 2}  % Alternative
  ```
</Accordion>

## Best Practices

### 1. Readability Guidelines

<Tip>
  **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`
</Tip>

<Warning>
  **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}`
</Warning>

### 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

<CodeGroup>
  ```latex standard-notations.tex theme={null}
  % 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)
  ```
</CodeGroup>

### 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

| Command               | Result                        | Description                    |
| --------------------- | ----------------------------- | ------------------------------ |
| `x_1`                 | $x_1$                         | Single subscript               |
| `x^2`                 | $x^2$                         | Single superscript             |
| `x_{12}`              | $x_{12}$                      | Multiple character subscript   |
| `x^{2n}`              | $x^{2n}$                      | Multiple character superscript |
| `x_i^j`               | $x_i^j$                       | Combined sub/superscript       |
| `\sum_{i=1}^n`        | $\displaystyle\sum_{i=1}^n$   | Summation limits               |
| `\lim_{x \to 0}`      | $\displaystyle\lim_{x \to 0}$ | Limit notation                 |
| `f'(x)`               | $f'(x)$                       | Prime notation                 |
| `{}_{a}^{b}X_{c}^{d}` | ${}_a^b X_c^d$                | Pre-superscript/subscript      |
| `\textsubscript{2}`   | H$_2$O                        | Text mode subscript            |
| `^{14}\mathrm{C}`     | $^{14}\mathrm{C}$             | Isotope notation               |
| `T^{\mu\nu}_{\rho}`   | $T^{\mu\nu}_{\rho}$           | Tensor notation                |

## Related Topics

<CardGroup cols={2}>
  <Card title="Mathematical Expressions" icon="calculator" href="/learn/latex/mathematics/mathematical-expressions">
    Basic math mode and LaTeX subscript expressions
  </Card>

  <Card title="Equations Guide" icon="equals" href="/learn/latex/mathematics/equations">
    Multi-line and numbered equations
  </Card>

  <Card title="Matrices & Arrays" icon="table-cells" href="/learn/latex/mathematics/matrices">
    Matrix notation with subscript indices
  </Card>

  <Card title="LaTeX Symbols Reference" icon="list" href="/learn/reference/symbols">
    Complete symbol reference for subscripts
  </Card>

  <Card title="Chemistry Notation" icon="flask" href="/learn/latex/specialized-notation/chemistry">
    Chemical formula subscript notation
  </Card>

  <Card title="Physics Notation" icon="atom" href="/learn/latex/specialized-notation/physics">
    Physics symbols and tensor notation
  </Card>
</CardGroup>

## 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

<Warning>
  **LaTeX Cloud Studio** tip: Use our equation preview feature to instantly see how your subscripts and superscripts render. No compilation needed!
</Warning>
