Binomial Coefficients (Choose) in LaTeX

Write “n choose k” with amsmath’s \binom{n}{k}, which draws the two numbers stacked in parentheses. The plain TeX form {n \choose k} gives the same result but is discouraged with amsmath; \dbinom and \tbinom force the large or small size.

Binomial commands

  • \binom{n}{k}
    ( n k )

    n choose k (amsmath); size follows the context.

  • \dbinom{n}{k}
    ( n k )

    Display size, even inside a line of text.

  • \tbinom{n}{k}
    ( n k )

    Text size, even in a displayed equation.

  • {n \choose k}
    ( n k )

    Plain TeX form; the braces around it are required.

  • \binom{n}{k_1, k_2, k_3}
    ( n k 1 , k 2 , k 3 )

    Multinomial coefficient.

  • {}^{n}C_{k}
    n C k

    Combination notation used in some school courses.

  • \genfrac{(}{)}{0pt}{}{n}{k}
    ( n k )

    What \binom does under the hood; change the delimiters for other brackets.

Try it live

Change the formula and the preview redraws as you type. Copy the LaTeX, download a PNG or SVG, copy it for Word, or use Edit here on any example below to load it.

Templates

Binomial coefficient (n choose k) examples

Each result below is drawn from the LaTeX under it. Copy the code, edit it on this page, or open it in the full editor.

  • Formula

    ( n k ) = n ! k ! ( n − k ) !
    LaTeX
    \binom{n}{k} = \frac{n!}{k!\,(n-k)!}
  • Binomial theorem

    ( a + b ) n = ∑ k = 0 n ( n k ) a n − k b k
    LaTeX
    (a + b)^n = \sum_{k=0}^{n} \binom{n}{k} a^{n-k} b^{k}
  • Pascal’s rule

    ( n k ) = ( n − 1 k − 1 ) + ( n − 1 k )
    LaTeX
    \binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}
  • Binomial distribution

    P ( X = k ) = ( n k ) p k ( 1 − p ) n − k
    LaTeX
    P(X = k) = \binom{n}{k} p^k (1 - p)^{n-k}
  • A number

    ( 5 2 ) = 10
    LaTeX
    \binom{5}{2} = 10
  • Multinomial coefficient

    ( n k 1 , k 2 , … , k m ) = n ! k 1 ! k 2 ! ⋯ k m !
    LaTeX
    \binom{n}{k_1, k_2, \ldots, k_m} = \frac{n!}{k_1!\, k_2! \cdots k_m!}
  • Text size in a display

    ( n 2 )  pairs out of  n
    LaTeX
    \tbinom{n}{2} \text{ pairs out of } n

    \tbinom keeps the coefficient small even in a displayed equation.

\binom or \choose?

\binom{n}{k} comes from amsmath and takes its two parts as arguments, like \frac. \choose is an older plain TeX command that sits between the two parts and takes everything in the surrounding group, so it must be wrapped in braces: {n \choose k}.

With amsmath loaded, \choose still works but amsmath treats it as a “foreign” plain TeX command and may print a warning suggesting \binom. For new documents use \binom.

LaTeX
\usepackage{amsmath}
% ...
There are $\binom{5}{2} = 10$ ways to pick two of five.

Sizes inline and in displays

\binom adapts to where it is used: smaller in running text, full size in a displayed equation. \dbinom forces the display size and \tbinom the text size, the same way \dfrac and \tfrac work for fractions.

Common mistakes

  • Without braces \choose takes the whole group on each side, so the +1 ends up in the bottom row.

    Instead of
    n \choose k + 1
    Write
    {n \choose k} + 1
  • A fraction has a bar and typed parentheses do not stretch; a binomial coefficient has no bar.

    Instead of
    (\frac{n}{k})
    Write
    \binom{n}{k}
  • \binom is not part of plain LaTeX; without amsmath you get “Undefined control sequence”.

    Instead of
    \binom{n}{k}  (without amsmath in LaTeX)
    Write
    \usepackage{amsmath}  % in the preamble

In Overleaf, MathJax and Word

  • Overleaf and pdfLaTeX

    \binom, \dbinom, \tbinom and \genfrac need \usepackage{amsmath}. \choose works without it.

  • MathJax and KaTeX

    MathJax and KaTeX support \binom, \dbinom, \tbinom and {n \choose k} directly, so either form works in Markdown and on web pages.

  • Microsoft Word

    Word can show binomial coefficients as a stacked fraction without a bar inside parentheses, but pasted LaTeX is not converted reliably. Write it here and use Copy for Word to paste an editable equation.

Binomial coefficient (n choose k) in LaTeX: questions

How do I write n choose k in LaTeX?
Use \binom{n}{k} with amsmath loaded. It prints n over k inside parentheses.
What is the difference between \binom and \choose?
They look the same. \binom{n}{k} is the amsmath command with two arguments; {n \choose k} is the older plain TeX syntax, which needs braces and can trigger an amsmath warning.
How do I make a binomial coefficient smaller or larger?
\tbinom{n}{k} forces the small text size and \dbinom{n}{k} the large display size.
How do I write the nCr notation?
Write it with scripts: {}^{n}C_{r} or C(n, r). In most math writing the stacked \binom{n}{r} is the expected form.

Have the formula as a picture?

Paste a screenshot or photo of the equation and get its LaTeX, ready to copy or open in the editor.

Convert an image to LaTeX