Brackets and Parentheses in LaTeX: Sizing, \left \right, and Matrix Brackets

Parentheses and square brackets are typed as they are. Curly braces need a backslash, angle brackets need \langle and \rangle, and anything wrapped around a fraction, a sum or a matrix needs to grow to fit. This guide covers every delimiter LaTeX offers, automatic sizing with \left and \right, the manual \big to \Bigg sizes, matrix brackets, piecewise cases, braces over and under expressions, the mathtools way to define \abs and \norm, and the errors that come up.

The Delimiters

In math mode, round and square brackets are ordinary characters. Everything else is a command, and most come in an opening and a closing form:

BracketCodeNotes
( )( )Typed directly
[ ][ ]Typed directly
{ }\{ \} or \lbrace \rbraceBare braces group and print nothing
⟨ ⟩\langle \rangleAngle brackets; not < >
| |\lvert \rvertAbsolute value (amsmath); plain | also works
‖ ‖\lVert \rVertNorm (amsmath); plain \| also works
⌊ ⌋\lfloor \rfloorFloor
⌈ ⌉\lceil \rceilCeiling
/ \/ \backslashSlashes can be sized too
⌜ ⌝\ulcorner \urcorneramssymb; also \llcorner \lrcorner
\usepackage{amsmath, amssymb}

$(a)$ $[b]$ $\{c\}$ $\langle d \rangle$ $\lvert e \rvert$ $\lVert f \rVert$
$\lfloor g \rfloor$ $\lceil h \rceil$

The full list, including \lgroup, \lmoustache and the arrows that can act as delimiters, is in the brackets symbol reference.

Why < and > are the wrong angle brackets

$<x, y>$ compiles, but it is wrong twice over. The characters are the less-than and greater-than relations, so TeX surrounds them with the wide spacing it puts around =, and their glyphs are shorter and more open than real angle brackets. \langle and \rangle are proper opening and closing delimiters with the right shape, the right spacing, and the ability to grow with \left and \right. Outside math, \textlangle and \textrangle give the text-mode versions.

Bars: | versus \lvert, \mid and \|

A plain | is an ordinary symbol, so TeX does not know whether it opens or closes. In $|-x|$ the minus sign is treated as binary and gets space on both sides. \lvert ... \rvert fixes that by declaring an opening and a closing bar. When the bar is a relation, as in set-builder notation or conditional probability, use \mid instead, which gets relation spacing on both sides. \| and \lVert ... \rVert are the double-bar equivalents for norms.

Curly Braces in Text and Math

Braces are LaTeX's grouping characters, so { and } never print by themselves. \{ and \} print them in both text and math; \lbrace and \rbrace are the math-only synonyms. The other reserved characters are covered in the special characters guide.

Text braces \{ \}, a set $\{1, 2, 3\}$,
set-builder $\{\, x \in \mathbb{R} \mid x > 0 \,\}$.

The thin spaces \, inside the set-builder braces are a typographic convention, not a requirement; they stop the braces from crowding the contents.

Accolades, braces, curly brackets: printing them in text

Curly braces go by several names: accolades in Dutch and French, curly brackets in British usage, braces in American usage and in the TeX documentation. Whatever you call them, they are the only bracket that needs escaping. Parentheses and square brackets print as typed in text and in math, and \textbraceleft and \textbraceright are the text-mode names of \{ and \}, useful inside \texttt. For a snippet of code that is full of braces, \verb prints its argument literally:

Parentheses (like these) and square brackets [like these] print as typed.
Accolades, or curly braces, need a backslash: \{ and \}.
In typewriter type: \texttt{\{\}} or \texttt{\textbraceleft\textbraceright}.
A literal command: \verb|\section{Title}| prints the braces as well.

One square-bracket trap: a [ directly after \item, \\ or a sectioning command is read as the start of an optional argument. Hide it in a group: \item {[}a, b] is an interval.

Automatic Sizing with \left and \right

Brackets around a fraction, a sum with limits or a matrix should be as tall as the contents. Put \left before the opening delimiter and \right before the closing one, and TeX picks a size that covers whatever is between them:

\[
  \left( \frac{a}{b} \right) \quad
  \left[ \frac{a}{b} \right] \quad
  \left\{ \frac{a}{b} \right\} \quad
  \left\langle \frac{a}{b} \right\rangle \quad
  \left\lvert \frac{a}{b} \right\rvert \quad
  \left\lVert \frac{a}{b} \right\rVert \quad
  \left\lfloor \frac{a}{b} \right\rfloor \quad
  \left\lceil \frac{a}{b} \right\rceil
\]

Three rules govern the pair. They must match one-to-one, every \left needs a \right, and both must sit in the same line and the same alignment cell. They do not have to be the same shape: \left( can be closed by \right] for a half-open interval.

One-sided brackets with \right. and \middle

A period after \left or \right is an invisible delimiter. That is how you size a single bar for evaluation at a point, and it is also how a pair is split across lines (see below). For a bar in the middle of a sized pair, such as the conditional bar in a probability or the bar in bra-ket notation, use \middle, which every current engine provides:

\[
  \left. \frac{\partial f}{\partial x} \right|_{x=0}
  \qquad
  \left( \frac{a}{b} \middle| c \right)
  \qquad
  \left\langle \psi \middle| \phi \right\rangle
\]

When \left and \right pick the wrong size

Automatic sizing is not always best. \left( \sum_{i=1}^{n} x_i \right) in a display produces brackets that cover the limits above and below the sum, which is taller than most people want; \Bigl( \sum_{i=1}^{n} x_i \Bigr) looks better. Around a plain \tfrac or a superscript, \left also adds a small extra space on each side because it turns the pair into an inner formula. For these cases, the manual sizes are the tool.

Manual Sizes: \big, \Big, \bigg, \Bigg

Four fixed sizes grow from 1.2 to 3 times the height of a normal bracket. Each has an opening form ending in l, a closing form ending in r, and a middle form ending in m for relations; the bare command (\big() makes an ordinary symbol with no spacing information, so the l and r forms are the ones to use:

\[ ( \bigl( \Bigl( \biggl( \Biggl( x \Biggr) \biggr) \Bigr) \bigr) ) \]
\[ \bigl\{ \Bigl[ \biggl\langle \Biggl\lvert x \Biggr\rvert \biggr\rangle \Bigr] \bigr\} \]
\[ \bigl\langle \psi \bigm| \phi \bigr\rangle \]
SizeOpen / close / middleHeight (10pt font)
normal( ) |as the text
\big\bigl \bigr \bigm12pt (1.2×)
\Big\Bigl \Bigr \Bigm18pt (1.8×)
\bigg\biggl \biggr \biggm24pt (2.4×)
\Bigg\Biggl \Biggr \Biggm30pt (3×)

Manual sizes have two advantages over \left and \right: they do not need to be matched, so they can be split across lines freely, and they let you choose a size that is slightly smaller than the automatic one, which usually looks better. A common rule of thumb is \bigl for a fraction or superscript, \Bigl for a sum or integral, and \biggl or \Biggl for stacked fractions. Plain TeX's \big sizes are fixed; amsmath makes them scale with the current font size, which is one more reason to load it.

Intervals, Sets and Inner Products

The everyday uses of brackets rarely need sizing, but each has one detail worth knowing. Intervals mix bracket types freely, and the reversed-bracket notation used in French and Dutch texts works because ] and [ are ordinary characters in math. Set-builder notation needs \mid rather than | so the bar gets relation spacing. Inner products are \langle and \rangle, never < and >:

% Intervals: closed, open, half-open, and the French ]a, b[ for open
$[a, b]$ \quad $(a, b)$ \quad $[a, b)$ \quad $]a, b[$ \quad $(-\infty, 0]$

% Sets and set-builder notation
$\{1, 2, 3\}$ \quad $\{\, x \in \mathbb{R} \mid x > 0 \,\}$ \quad $\emptyset = \{\}$

% Inner product, and the physics bra-ket
$\langle u, v \rangle$ \quad $\langle \psi \mid \phi \rangle$

% Sizing examples: tall contents, matched brackets
\[
  \left[ \frac{\sum_{i=1}^{n} x_i}{n} \right]
  \qquad
  \left\{ x \in \mathbb{R} : x > 0 \right\}
  \qquad
  \left\langle \frac{u}{\|u\|}, v \right\rangle
\]

Nested Brackets

Mathematical convention nests square brackets outside parentheses and braces outside those, with each level a step larger. Manual sizes express the hierarchy exactly; \left and \right make the outer pair only as big as the inner one, so the levels blend together:

\[
  \Bigl[ \bigl( a + b \bigr) \bigl( c + d \bigr) \Bigr]^2
  \qquad
  \left[ \left( a + b \right) \left( c + d \right) \right]^2   % all the same size
\]
\[ f\bigl(g(x)\bigr) \]

Brackets Around Fractions

\[
  \left( \frac{1}{2} \right)   % automatic: full height
  \quad \bigl( \tfrac{1}{2} \bigr)   % small fraction, slightly enlarged bracket
  \quad (\tfrac{1}{2})              % small fraction, normal bracket
  \quad \left( \frac{a}{b} \right)^{\!2}   % \! pulls the exponent closer
\]

Inline, $(\frac{a}{b})$ is typeset in text style, where the fraction is only slightly taller than the line and normal brackets are usually fine. The mathematical expressions guide covers \frac, \tfrac and \dfrac in detail.

Brackets Across Line Breaks

A pair sized with \left and \right cannot span a \\ in an align or split, nor an &. Either close each line with the invisible \right. and reopen the next with \left., or use manual sizes, which have no such restriction. The manual version is more reliable, because the two halves of a split \left pair are sized independently and can come out different heights:

\begin{align}
  f(x) &= \Bigl( a + b + c \\
       &\qquad + d + e \Bigr)
\end{align}

\begin{align}
  f(x) &= \left( a + b + c \right. \\
       &\qquad \left. + d + e \right)
\end{align}

The multi-line equations guide covers the align and split environments used here.

Matrix Brackets

amsmath provides one matrix environment per bracket style. They all use & between columns and \\ between rows, and they size the brackets automatically:

EnvironmentBracketsTypical use
matrixnoneBuilding block inside other delimiters
pmatrix( )Matrices and vectors
bmatrix[ ]Matrices (common in engineering)
Bmatrix{ }Sets of vectors, rarely
vmatrix| |Determinants
Vmatrix‖ ‖Matrix norms
smallmatrixnoneInline; psmallmatrix, bsmallmatrix etc. with mathtools
\usepackage{amsmath, mathtools}

\[
  \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}
  \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}
  \begin{Bmatrix} 1 & 2 \\ 3 & 4 \end{Bmatrix}
  \begin{vmatrix} 1 & 2 \\ 3 & 4 \end{vmatrix}
  \begin{Vmatrix} 1 & 2 \\ 3 & 4 \end{Vmatrix}
\]

% without amsmath, or for a vertical rule between columns
\[
  \left( \begin{array}{cc} 1 & 2 \\ 3 & 4 \end{array} \right)
  \qquad
  \left[ \begin{array}{cc|c} 1 & 2 & 5 \\ 3 & 4 & 6 \end{array} \right]
\]

$M = \begin{psmallmatrix} 1 & 2 \\ 3 & 4 \end{psmallmatrix}$ inline.

The array fallback is also the way to get an augmented matrix, because its column specification accepts |. Column alignment, dots, block matrices and determinants are covered in the matrices guide.

Piecewise Functions: cases

cases is a left brace that grows to cover a set of alternatives, with & separating the value from its condition:

\[
  |x| = \begin{cases}
    x  & \text{if } x \ge 0 \\
    -x & \text{if } x < 0
  \end{cases}
\]

Entries are set in text style, so a fraction inside comes out small; mathtools' dcases is the same environment in display style. rcases (also mathtools) puts the brace on the right.

Horizontal Braces: \underbrace and \overbrace

\[
  \underbrace{a + b + \cdots + z}_{26 \text{ terms}}
  \qquad
  \overbrace{x + y}^{\text{sum}}
\]

The label goes in a subscript for \underbrace and a superscript for \overbrace. mathtools adds \underbracket and \overbracket with square ends.

Defining \abs and \norm with mathtools

Typing \lvert x \rvert for every absolute value is verbose, and switching between automatic and manual sizing means editing both ends. mathtools' \DeclarePairedDelimiter defines a command that takes the contents as its argument and offers all three sizing modes:

\usepackage{mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor}
\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}
\DeclarePairedDelimiter{\inner}{\langle}{\rangle}

\[
  \abs{x}                  % normal size
  \quad \abs*{\frac{a}{b}}   % * = \left \right
  \quad \abs[\Big]{\frac{a}{b}}   % optional argument = manual size
  \quad \norm{v} \quad \floor{x} \quad \ceil*{\frac{n}{2}} \quad \inner{u, v}
\]

The physics package offers ready-made \abs, \norm and \bra/\ket commands, but it has well-documented spacing quirks; \DeclarePairedDelimiter is the standard recommendation, and the braket package is a lighter alternative for quantum notation.

Pasting Unicode Brackets

Copying ⟨, ⟩ or ‖ from a web page into a pdfLaTeX document does not give you a delimiter. Current LaTeX maps those characters to the text symbols \textlangle, \textrangle and \textbardbl, so in math mode the document compiles with the warning Command \textlangle invalid in math mode and prints a small text glyph that neither spaces nor scales like a bracket. Characters with no text mapping, such as ⌊ (U+230A), stop with Unicode character ⌊ (U+230A) not set up for use with LaTeX. Replace all of them with the commands above. Under XeLaTeX or LuaLaTeX with the unicode-math package the characters are accepted in math mode and map to the same delimiters, so \left⟨ x \right⟩ works; without unicode-math they are printed, if at all, as text glyphs with no delimiter behaviour.

Common Errors and Fixes

Message or symptomCauseFix
Missing \right. inserted, or inside align Extra }, or forgotten \rightA \left with no \right before the end of the math, the line or the alignment cellAdd \right with a delimiter or \right.; for multi-line brackets use \bigl/\bigr
Extra \rightA \right with no open \left, often after a \\ or &Open the line with \left. or switch to manual sizes
Missing delimiter (. inserted)The token after \left or \right is not a delimiter, e.g. a bare brace in \left{ or a command such as \left\fracUse \left\{; only delimiters (brackets, bars, \langle, .) may follow \left
Brackets too tall around a sum\left covers the limits above and below\Bigl( \sum ... \Bigr)
Split pair has different heights on each line\right. and \left. size each half separatelyUse the same manual size on both lines, or \vphantom to equalise
Angle brackets look like < > with wide spacesRelation symbols used as delimiters\langle \rangle
Missing $ inserted on a \langleMath delimiter used in textWrap in $...$ or use \textlangle
Environment bmatrix undefined, or Misplaced alignment tab character & inside pmatrixamsmath not loaded (LaTeX inherits plain TeX's \pmatrix command, so pmatrix fails differently from the others)\usepackage{amsmath}
Command \textlangle invalid in math mode, or Unicode character ⌊ (U+230A) not set up for use with LaTeXPasted Unicode bracket under pdfLaTeXReplace with \langle, or compile with XeLaTeX/LuaLaTeX and unicode-math
Too many }'s near a setLiteral braces typed as { }\{ \}

Complete Example

\documentclass{article}
\usepackage{amsmath, amssymb, mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}

\begin{document}

\section{Sizing}
\[
  \left( \frac{a}{b} \right)
  \quad \Bigl( \sum_{i=1}^{n} x_i \Bigr)
  \quad \Bigl[ \bigl( a + b \bigr) \bigl( c + d \bigr) \Bigr]^2
  \quad \left. \frac{df}{dx} \right|_{x=0}
\]

\section{Angle brackets, bars and norms}
\[
  \langle u, v \rangle
  \quad \abs*{\frac{a}{b}}
  \quad \norm{v}_2
  \quad \{\, x \in \mathbb{R} \mid \abs{x} < 1 \,\}
  \quad \left\langle \psi \middle| \phi \right\rangle
\]

\section{Matrices and cases}
\[
  A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, \qquad
  \det A = \begin{vmatrix} 1 & 2 \\ 3 & 4 \end{vmatrix}, \qquad
  \operatorname{sgn}(x) = \begin{cases}
    1  & x > 0 \\
    0  & x = 0 \\
    -1 & x < 0
  \end{cases}
\]

\section{Across lines}
\begin{align}
  F(x) &= \Bigl( a_1 + a_2 + \cdots + a_n \\
       &\qquad + \underbrace{b_1 + \cdots + b_m}_{m \text{ terms}} \Bigr)
\end{align}

\end{document}

Quick Reference

TaskCode
Curly braces\{ ... \}
Angle brackets\langle ... \rangle
Absolute value\lvert x \rvert (amsmath)
Norm\lVert v \rVert
Floor, ceiling\lfloor x \rfloor, \lceil x \rceil
Auto-sized pair\left( ... \right)
One-sided bar\left. ... \right|_{x=0}
Middle bar\left( a \middle| b \right)
Manual sizes\bigl( \Bigl( \biggl( \Biggl( with \bigr) etc.
Pair across lines\Bigl( ... \\ ... \Bigr) or \right. / \left.
Matrix in ( ) [ ] { } | | ‖ ‖pmatrix bmatrix Bmatrix vmatrix Vmatrix
Augmented matrix\left[ \begin{array}{cc|c} ... \end{array} \right]
Piecewise\begin{cases} a & \text{if } ... \\ b & \text{otherwise} \end{cases}
Brace under / over\underbrace{...}_{label}, \overbrace{...}^{label}
Define \abs\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}, then \abs{x}, \abs*{...}, \abs[\Big]{...}

Frequently Asked Questions

How do I write angle brackets in LaTeX?

Use \langle and \rangle in math mode: $\langle x, y \rangle$. Do not use < and >, which are the less-than and greater-than relations and get the wrong shape and spacing. In text mode use \textlangle and \textrangle.

How do I make brackets bigger in LaTeX?

Wrap the contents in \left( ... \right) and LaTeX sizes the brackets automatically to the height of what is between them. For manual control use \bigl( \Bigl( \biggl( \Biggl( with the matching \bigr) and so on; these four sizes grow from 1.2 to 3 times the normal height.

How do I put brackets around a matrix?

Use the amsmath matrix environments: pmatrix for parentheses, bmatrix for square brackets, Bmatrix for curly braces, vmatrix for single bars (a determinant) and Vmatrix for double bars. Plain matrix has no brackets. Without amsmath, wrap an array in \left( ... \right).

Why do I get “Missing \right. inserted”?

Every \left must be matched by a \right in the same line and the same cell of an alignment. A \left( on one line of an align and the \right) on the next, or on the other side of an &, triggers this error (inside align it is reported as “Extra }, or forgotten \right”). Close the first line with \right. and open the next with \left. (the dot is an invisible delimiter), or use the manual \bigl and \bigr sizes, which need no matching.

What are accolades in LaTeX?

Accolades is the Dutch and French name for curly braces { }. In LaTeX they are grouping characters, so to print them write \{ and \} (in text or math), \textbraceleft and \textbraceright in text, or \lbrace and \rbrace in math. \left\{ ... \right\} sizes them automatically, and Bmatrix puts them around a matrix.

How do I write curly braces in LaTeX?

Braces are reserved for grouping, so escape them: \{ and \} work in both text and math. In math you can also write \lbrace and \rbrace, and \left\{ ... \right\} for automatic sizing. Bmatrix gives a matrix in braces and cases gives a left brace for piecewise definitions.

Next Steps

Brackets under control? These guides cover what goes inside them:

Free LaTeX Tools

Fix bracket errors faster with AI

Octree's AI editor finds the unmatched \left behind a “Missing \right. inserted” error, picks the right size for nested brackets, and compiles your document in seconds.

Try Octree Free →