Braces over and under terms in LaTeX
\underbrace and \overbrace draw a horizontal curly brace directly under or over a group of terms, with an optional label attached below (underbrace) or above (overbrace) the brace using _ or ^.
LaTeX command
\underbrace{a+b+c}_{\text{sum}}Not the symbol you meant? Draw it to find the command →
Typing up handwritten notes? Convert a whole page of handwriting to LaTeX →
\underbrace{...}_{label} braces the group from below and puts the label under the brace; \overbrace{...}^{label} does the mirror image, bracing from above with the label on top. The label itself is ordinary maths or \text{...} content, so it can be a word, a count, or a short expression.
They're most useful for annotating a step in a derivation, marking which terms came from where, or showing that a repeated sum of n identical terms equals n times that term. Nesting is allowed, an \underbrace can sit inside another brace's content to annotate a sub-part, though it gets visually busy fast.
Since the label sits in a subscript or superscript position, wrap any words in \text{} so they print upright rather than as run-together italic letters, and keep the label short, the brace narrows towards it and long text gets cramped.
Other forms
\overbrace{...}^{...}brace aboveExamples
$\underbrace{1+1+\cdots+1}_{n \text{ times}} = n$a labelled under-brace showing repetition
$\overbrace{a+b+c}^{\text{three terms}}$a labelled over-brace
$\underbrace{x^2 + 2x + 1}_{(x+1)^2}$marking a factored form under an expression
$\overbrace{\underbrace{a}_{1} + \underbrace{b}_{2}}^{\text{total}}$a nested brace example
Tips and common mistakes
- Use _ after
\underbraceand ^ after\overbracefor the label; forgetting the underscore or caret leaves the brace unlabelled. - Wrap word labels in
\text{...}so they render upright, not as italic maths letters run together. - The label sits at a subscript or superscript position, so long labels get squeezed, keep them short.
- Nesting braces is possible but readability drops fast past two levels, consider a caption instead if you need more annotation.
\underbraceand\overbraceare built into LaTeX, so they work in any document without an extra package.
Working from handwritten notes?
LatexNotes turns a photo or PDF of handwritten mathematics into LaTeX, graphs and all. It is built with real pdflatex before you see it, and the .tex file is yours to edit or take to Overleaf. Free to try, no sign-up.
See how handwriting to LaTeX works, step by step, or go from GoodNotes to LaTeX if you write on an iPad (Notability works the same way).
Convert your maths to LaTeX →FAQ
How do I add text under an underbrace?
Add _{\text{your words}} right after the closing brace of \underbrace{...}, wrapping the words in \text{} so they print upright, for example \underbrace{a+b}_{\text{sum}}.
What's the difference between \underbrace and \overbrace?
\underbrace draws the brace below the group with its label underneath, using _; \overbrace draws it above the group with its label on top, using ^.
Can I put a brace over just part of an equation?
Yes, only wrap the terms you want braced in \underbrace{...} or \overbrace{...}; the rest of the equation sits outside it as normal, for example x + \underbrace{y+z}_{\text{combine}}.
Can I nest braces?
Yes, one \underbrace or \overbrace can sit inside the content or label of another, but keep it to one or two levels, deeper nesting becomes hard to read.