All guides

Brackets in LaTeX

Updated:

Plain parentheses do not grow with a fraction inside them. Put \left and \right in front of them and LaTeX sizes them automatically. Curly braces need a backslash, because bare braces group code.

Try it with your own values

Edit the code and the preview updates as you type.

⟨u,v⟩{x}(ab)[x]\langle u, v \rangle \quad \{ x \} \quad \left( \frac{a}{b} \right) \quad \Bigl[ x \Bigr]
(x) \quad [x] \quad \{x\} \quad \langle x \rangle \quad |x| \quad \|x\| \quad \lfloor x \rfloor \quad \lceil x \rceil
(x)[x]{x}⟨x⟩∣x∣∥x∥⌊x⌋⌈x⌉(x) \quad [x] \quad \{x\} \quad \langle x \rangle \quad |x| \quad \|x\| \quad \lfloor x \rfloor \quad \lceil x \rceil

Round and square brackets are typed directly; curly braces need \{ \}, angle brackets \langle \rangle, floor \lfloor \rfloor and ceiling \lceil \rceil. None of them needs a package, and any of them can follow \left and \right to grow with the content.

Copying this from handwritten notes? Snap a photo of the page and CamteX turns the formulas into LaTeX. Try it free

\left( \frac{a}{b} \right)^2
(ab)2\left( \frac{a}{b} \right)^2

\left and \right measure everything between them and pick a matching size. They work with ( ), [ ], \{ \}, | and \langle \rangle, and the two sides do not have to be the same kind.

A = \{ x \in \mathbb{R} \mid x > 0 \}
A={x∈R∣x>0}A = \{ x \in \mathbb{R} \mid x > 0 \}

A bare { } groups code and prints nothing, so a set needs \{ and \}. \mid separates the element from its condition with the right spacing; \mathbb{R} needs the amssymb package.

|x|, \quad \|\vec{v}\|
∣x∣,∥v⃗∥|x|, \quad \|\vec{v}\|

| gives a single bar and \| a double one. For bars that grow with a fraction, write \left| ... \right|; the mathtools package also lets you define \abs and \norm once in the preamble.

[a, b), \quad \left[ \frac{1}{2}, 1 \right]
[a,b),[12,1][a, b), \quad \left[ \frac{1}{2}, 1 \right]

Square brackets need no backslash. A half-open interval simply mixes [ with ), and \left[ ... \right] sizes them exactly like round brackets.

\langle \psi | \phi \rangle
⟨ψ∣ϕ⟩\langle \psi | \phi \rangle

Angle brackets are \langle and \rangle. The < and > keys are relation signs with wide spacing around them, so they look wrong in bra-ket notation or an inner product.

\Bigl( (x + y)^2 - 1 \Bigr)
((x+y)2−1)\Bigl( (x + y)^2 - 1 \Bigr)

\bigl, \Bigl, \biggl and \Biggl give four fixed sizes, closed by the matching \bigr and so on. Use them for nested brackets that should differ in size, or when an equation breaks across lines.

\begin{pmatrix} a & b \\ c & d \end{pmatrix} \quad \begin{bmatrix} a & b \\ c & d \end{bmatrix} \quad \begin{vmatrix} a & b \\ c & d \end{vmatrix}
(abcd)[abcd]∣abcd∣\begin{pmatrix} a & b \\ c & d \end{pmatrix} \quad \begin{bmatrix} a & b \\ c & d \end{bmatrix} \quad \begin{vmatrix} a & b \\ c & d \end{vmatrix}

A matrix does not need \left( \right) around an array: choose the environment by its bracket. pmatrix gives round brackets, bmatrix square ones, Bmatrix curly braces, vmatrix the bars of a determinant and Vmatrix double bars. All five come from amsmath.

\left\{ x \in \mathbb{R} \;\middle|\; x^2 < \frac{1}{2} \right\}
{x∈R  |  x2<12}\left\{ x \in \mathbb{R} \;\middle|\; x^2 < \frac{1}{2} \right\}

\middle| stretches the separator to the height of the \left and \right around it, which \mid cannot do. Add \; on both sides yourself, because \middle does not bring the spacing of a relation. It works in pdfLaTeX, XeLaTeX and LuaLaTeX.

|x| = \begin{cases} x, & x \ge 0 \\ -x, & x < 0 \end{cases}
∣x∣={x,x≥0−x,x<0|x| = \begin{cases} x, & x \ge 0 \\ -x, & x < 0 \end{cases}

The cases environment from amsmath draws one tall curly brace on the left and aligns the conditions after &. For a brace on the right, write \left. \begin{array}{l} ... \end{array} \right\} instead.

\underbrace{a + a + \dots + a}_{n\ \text{times}} = na
a+a+⋯+a⏟n times=na\underbrace{a + a + \dots + a}_{n\ \text{times}} = na

\underbrace puts a horizontal curly brace under the term and its subscript becomes the label; \overbrace does the same above, with the label as a superscript. Both stretch to the width of the term.

\left. x^2 \right|_{0}^{2} = 4
x2∣02=4\left. x^2 \right|_{0}^{2} = 4

\left. is an invisible bracket that lets \right| stand alone. The bar with limits is the usual way to show an antiderivative evaluated between two points.

\cos\theta = \left\langle \frac{u}{\|u\|}, \frac{v}{\|v\|} \right\rangle
cos⁡θ=⟨u∥u∥,v∥v∥⟩\cos\theta = \left\langle \frac{u}{\|u\|}, \frac{v}{\|v\|} \right\rangle

A plain \langle keeps the height of one line next to a fraction. With \left and \right the angles stretch, here around the inner product of two unit vectors, which gives the cosine of the angle between them.

\Biggl( \biggl( \Bigl( \bigl( x \bigr) \Bigr) \biggr) \Biggr)
((((x))))\Biggl( \biggl( \Bigl( \bigl( x \bigr) \Bigr) \biggr) \Biggr)

Each step is a fixed height that ignores the content. Nesting brackets of growing size helps the reader pair them up in a long expression with three or four levels of grouping.

\begin{aligned} f(x) &= \left( \frac{a}{b} + c \right. \\ &\qquad \left. {} + d \vphantom{\frac{a}{b}} \right) \end{aligned}
f(x)=(ab+c+dab)\begin{aligned} f(x) &= \left( \frac{a}{b} + c \right. \\ &\qquad \left. {} + d \vphantom{\frac{a}{b}} \right) \end{aligned}

Each line needs its own pair, so the first ends with \right. and the next starts with \left. as invisible partners. \vphantom copies the height of the fraction, so both halves of the bracket match.

\left\{ \begin{aligned} x + y &= 3 \\ x - y &= 1 \end{aligned} \right.
{x+y=3x−y=1\left\{ \begin{aligned} x + y &= 3 \\ x - y &= 1 \end{aligned} \right.

\left\{ grows to the height of the aligned block from amsmath, and \right. closes it without a symbol. Use it for a system of equations when the equals signs should line up, which cases does not do.

\left. \begin{aligned} m &= 0.25\,\mathrm{kg} \\ g &= 9.81\,\mathrm{m/s^2} \end{aligned} \right\} \text{given}
m=0.25 kgg=9.81 m/s2}given\left. \begin{aligned} m &= 0.25\,\mathrm{kg} \\ g &= 9.81\,\mathrm{m/s^2} \end{aligned} \right\} \text{given}

Here the invisible bracket is on the left and the brace on the right. It groups several lines under one label, for example the values a problem gives you before the calculation starts.

\langle x \rangle = \frac{1}{N} \sum_{i=1}^{N} x_i, \quad \sigma^2 = \langle x^2 \rangle - \langle x \rangle^2
⟨x⟩=1N∑i=1Nxi,σ2=⟨x2⟩−⟨x⟩2\langle x \rangle = \frac{1}{N} \sum_{i=1}^{N} x_i, \quad \sigma^2 = \langle x^2 \rangle - \langle x \rangle^2

Physics texts often mark an average or expectation value with angle brackets instead of a bar. The variance line shows why: the mean of the squares and the square of the mean stay easy to tell apart.

\langle u, v \rangle = \sum_{i=1}^{n} u_i v_i, \quad \left\langle \psi \middle| \hat{A} \middle| \psi \right\rangle
⟨u,v⟩=∑i=1nuivi,⟨ψ|A^|ψ⟩\langle u, v \rangle = \sum_{i=1}^{n} u_i v_i, \quad \left\langle \psi \middle| \hat{A} \middle| \psi \right\rangle

A comma between the vectors is the linear algebra form, bars are the quantum mechanics form. \middle| stretches each bar with the outer angles; the braket package shortens this to \Braket{\psi | \hat{A} | \psi}.

Common mistakes and fixes

WrongRightWhy
<u, v>\langle u, v \rangleThe less-than and greater-than keys are relation signs with wide spacing around them, so they never look like brackets.
\big( -x \big)\bigl( -x \bigr)A bare \big makes an ordinary symbol, so the minus after it gets the spacing of subtraction; \bigl and \bigr mark the opening and closing side.
\{ \begin{aligned} x + y &= 3 \\ x - y &= 1 \end{aligned}\left\{ \begin{aligned} x + y &= 3 \\ x - y &= 1 \end{aligned} \right.A plain \{ keeps the height of one line, while \left\{ grows with the block and needs \right. as its partner.
| \frac{a}{b} |\left| \frac{a}{b} \right|Plain bars stay at text height and look too short next to a fraction.

Frequently asked questions

How do you make big brackets in LaTeX?
Put \left before the opening bracket and \right before the closing one, for example \left( \frac{a}{b} \right). LaTeX measures what is inside and picks the height. For a fixed size use \big, \Big, \bigg or \Bigg instead.
How do you type curly brackets in LaTeX?
Write \{ and \} with a backslash. Bare braces only group code and print nothing. Curly brackets that grow with their content are \left\{ ... \right\}.
How do you write square brackets in LaTeX?
Type [ and ] directly, they need no backslash. Around a tall expression use \left[ ... \right], and for a matrix in square brackets use the bmatrix environment.
How do you write angle brackets in LaTeX?
Use \langle and \rangle. The < and > keys are relation signs with wide spacing, so they look wrong as brackets.
What is the difference between \left( and \bigl(?
\left and \right choose the size automatically and must form a pair inside one line of an equation. \bigl, \Bigl, \biggl and \Biggl are four fixed sizes that you pick yourself, and they also work when an equation breaks across lines.

See also

Don't want to memorize commands?

Draw a formula or paste a screenshot, and CamteX turns it into ready LaTeX.

Try it free