Skip to content
MoneyDeck

Pascal's Triangle Generator

Build Pascal’s triangle to any row and read off binomial coefficients

Updated · Free, no signup

Prints rows 0 through rows − 1 (10 rows = rows 0–9).

Row numbers start at 0.

0 ≤ k ≤ n.

C(n, k)

120

Row n

1 10 45 120 210 252 210 120 45 10 1

Sum of row n (2ⁿ)

1024

(a + b)ⁿ expanded

a^10 + 10a^9b + 45a^8b^2 + 120a^7b^3 + 210a^6b^4 + 252a^5b^5 + 210a^4b^6 + 120a^3b^7 + 45a^2b^8 + 10ab^9 + b^10

Pascal's triangle

             1
            1 1
           1 2 1
          1 3 3 1
         1 4 6 4 1
       1 5 10 10 5 1
     1 6 15 20 15 6 1
    1 7 21 35 35 21 7 1
  1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1

Numbers in the printed triangle

55

Largest number in row n

252
  • C(10, 3) = 10! / (3! · 7!) is the number of ways to choose 3 items from 10, and the coefficient of a^7b^3 in (a + b)^10.
  • By symmetry C(10, 3) = C(10, 7).

Coefficients in row n

Printed rows

RowValuesRow sum
011
11 12
21 2 14
31 3 3 18
41 4 6 4 116
51 5 10 10 5 132
61 6 15 20 15 6 164
71 7 21 35 35 21 7 1128
81 8 28 56 70 56 28 8 1256
91 9 36 84 126 126 84 36 9 1512

About the Pascal's Triangle Generator

This Pascal's triangle generator builds the triangle row by row and highlights the binomial coefficient you need. Choose how many rows to print (up to 30), then pick a row n and position k to get C(n, k) — the number in row n, position k, counting both from zero — together with the full row, the row sum 2ⁿ and the binomial expansion of (a + b)ⁿ.

It is useful for students learning the binomial theorem or combinations, teachers who need a printable triangle, and anyone who wants exact large binomial coefficients: rows up to n = 500 are computed with arbitrary-precision integers, so C(100, 50) comes out as all 30 digits rather than a rounded decimal.

Rows and positions start at 0, the usual convention: row 0 is the single 1 at the top, and row 4 is 1 4 6 4 1, so C(4, 2) = 6.

How to use the pascal's triangle generator

  1. 1Choose how many rows of the triangle to print.
  2. 2Enter the row n you are interested in (the top row is row 0).
  3. 3Enter the position k within that row (the first number is position 0).
  4. 4Read C(n, k), the full row, its sum and the (a + b)ⁿ expansion.
  5. 5Copy the printed triangle for worksheets or notes.

Formula and method

C(n, k) = C(n − 1, k − 1) + C(n − 1, k) = n! / (k!(n − k)!)

Every entry of Pascal's triangle is the sum of the two entries directly above it, with 1s along both edges. The entry in row n, position k is the binomial coefficient C(n, k) = n!/(k!(n − k)!), which counts the ways to choose k objects from n and is the coefficient of aⁿ⁻ᵏbᵏ in (a + b)ⁿ by the binomial theorem.

To compute a single row quickly without factorials, this generator uses the multiplicative rule C(n, k) = C(n, k − 1) × (n − k + 1)/k with exact big integers. Each row is symmetric, sums to 2ⁿ, and has its largest value in the middle.

n
Row number, starting at 0
k
Position in the row, starting at 0
C(n, k)
Binomial coefficient "n choose k"

Worked examples

Row 10, position 3

C(10, 3) = 10·9·8 / (3·2·1) = 120. Row 10 is 1 10 45 120 210 252 210 120 45 10 1, it sums to 2¹⁰ = 1024, and the 10 printed rows (rows 0–9) contain 1 + 2 + … + 10 = 55 numbers.

Expanding (a + b)⁵

Row 5 is 1 5 10 10 5 1, so (a + b)⁵ = a⁵ + 5a⁴b + 10a³b² + 10a²b³ + 5ab⁴ + b⁵. The highlighted C(5, 2) = 10 is the coefficient of a³b².

Exact large coefficient C(100, 50)

C(100, 50) has 30 digits — too many for ordinary floating point — but the exact big-integer row gives 100,891,344,545,564,193,334,812,497,256. Row 100 sums to 2¹⁰⁰.

Frequently asked questions

How do you build Pascal's triangle?+

Start with a 1 at the top (row 0). Each new row begins and ends with 1, and every inner number is the sum of the two numbers diagonally above it. Row 4, for example, is 1 4 6 4 1 because 1+3 = 4 and 3+3 = 6.

How is Pascal's triangle related to the binomial theorem?+

Row n lists the coefficients of (a + b)ⁿ. For instance row 3 is 1 3 3 1, so (a + b)³ = a³ + 3a²b + 3ab² + b³. The k-th entry is C(n, k), "n choose k".

What is the sum of a row in Pascal’s triangle?+

Row n sums to 2ⁿ, because setting a = b = 1 in (a + b)ⁿ adds up every coefficient. Row 10, for example, sums to 1,024.

What patterns are hidden in Pascal's triangle?+

The diagonals contain the counting numbers, the triangular numbers and the tetrahedral numbers; shallow diagonals sum to Fibonacci numbers; and colouring odd entries produces the Sierpiński triangle fractal.

Do rows start at 0 or 1?+

By convention both rows and positions start at 0: the single 1 at the top is row 0, and the first entry of each row is position 0. That way row n, position k equals C(n, k).

Related tools