ToolNimba Browse

🔺 Pascal Triangle Generator

By ToolNimba Math Team · Updated 2026-06-19

Pascal's triangle
-
Selected entry
Click any number in the triangle to see its binomial coefficient.

Enter how many rows you want (1 to 25). Row 0 is the single 1 at the top.

Pascal's triangle is a number pattern where every row begins and ends with 1, and each inner number is the sum of the two numbers directly above it. This generator builds the first N rows for you (up to 25), draws them as a neat centered triangle, and lets you click any number to see it as a binomial coefficient C(n, k). Enter the number of rows and read the pattern off instantly, then copy it as text or CSV.

What is the Pascal Triangle Generator?

Pascal's triangle is a triangular array of numbers named after the French mathematician Blaise Pascal, though it was studied centuries earlier in India, Persia, China and elsewhere. The construction rule is simple: write 1 at the apex (this is row 0), then build each new row so that it starts and ends with 1 and every entry in between equals the sum of the two entries immediately above it to the left and right. So row 1 is 1 1, row 2 is 1 2 1, row 3 is 1 3 3 1, row 4 is 1 4 6 4 1, and the pattern continues forever.

The deep reason the triangle matters is that its entries are exactly the binomial coefficients. The number in row n at position k (counting both from 0) equals C(n, k), read as n choose k, which is n! ÷ (k! × (n − k)!). This is the count of distinct ways to choose k items from a set of n, and it is also the coefficient of the term containing one variable raised to the k power when you expand (a + b) to the n power. For example, (a + b) squared = 1a² + 2ab + 1b², and those coefficients 1, 2, 1 are precisely row 2 of the triangle.

Because the additive rule and the choose formula describe the same numbers, the triangle ties together combinatorics, algebra and probability in one picture. The rows sum to powers of 2 (each row n adds up to 2 to the n), the second diagonal lists the counting numbers 1, 2, 3, 4 and the third lists the triangular numbers 1, 3, 6, 10. The triangle is symmetric left to right because choosing k items to keep is the same as choosing n − k items to leave behind, so C(n, k) = C(n, n − k).

When to use it

  • Looking up a binomial coefficient C(n, k) quickly without typing out factorials by hand.
  • Reading off the coefficients to expand a binomial like (a + b) raised to a power in algebra homework.
  • Teaching or learning the additive build rule and the symmetry of the triangle in a classroom.
  • Finding combinatorics values (number of ways to choose k from n) for probability problems.

How to use the Pascal Triangle Generator

  1. Enter the number of rows you want, from 1 up to 25.
  2. Read the centered triangle: row 0 is the single 1 at the top.
  3. Click any number to see it written as a binomial coefficient C(n, k) with its meaning.
  4. Use Copy text or Copy CSV to export the whole triangle for a spreadsheet or document.

Formula & method

Entry in row n, position k equals C(n, k) = n! ÷ (k! × (n − k)!). Build rule: C(n, k) = C(n−1, k−1) + C(n−1, k), with C(n, 0) = C(n, n) = 1. Each row n sums to 2 to the power n.

Worked examples

Build row 4 from row 3 using the additive rule.

  1. Row 3 is 1 3 3 1.
  2. New row starts with 1.
  3. Next entry = 1 + 3 = 4.
  4. Next entry = 3 + 3 = 6.
  5. Next entry = 3 + 1 = 4.
  6. New row ends with 1.

Result: Row 4 = 1 4 6 4 1, which are the coefficients of (a + b) to the 4th power.

Find C(5, 2), the entry in row 5, position 2.

  1. Use C(n, k) = n! ÷ (k! × (n − k)!).
  2. C(5, 2) = 5! ÷ (2! × 3!).
  3. 5! = 120, 2! = 2, 3! = 6.
  4. C(5, 2) = 120 ÷ (2 × 6) = 120 ÷ 12.

Result: C(5, 2) = 10, which matches the third number in row 5 (1 5 10 10 5 1).

The first eight rows of Pascal’s triangle and what each row tells you

Row nEntriesRow sum (2 to the n)
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

Patterns hidden in the diagonals of the triangle

DiagonalSequence it producesName
1st (outer edge)1, 1, 1, 1, 1All ones
2nd1, 2, 3, 4, 5Counting (natural) numbers
3rd1, 3, 6, 10, 15Triangular numbers
4th1, 4, 10, 20, 35Tetrahedral numbers

Common mistakes to avoid

  • Counting rows starting at 1 instead of 0. The apex is row 0, not row 1. The same applies to positions within a row, which also start at 0. Counting from 1 throws off the C(n, k) lookup, since the single 1 at the top is C(0, 0).
  • Forgetting the edges are always 1. Every row must begin and end with 1 because C(n, 0) and C(n, n) both equal 1. If your row does not start and end with 1, an entry has been added incorrectly.
  • Confusing the additive rule direction. An inner entry is the sum of the two numbers above it, one to the left and one to the right, not the two beside it in the same row. Reading sideways gives the wrong value.
  • Mixing up C(n, k) with the factorial n!. A triangle entry is a binomial coefficient C(n, k) = n! ÷ (k! × (n − k)!), not a plain factorial. The factorials cancel a lot, so the result is much smaller than n! alone.

Glossary

Pascal's triangle
A triangular array where each row starts and ends with 1 and every inner number is the sum of the two numbers above it.
Binomial coefficient
The value C(n, k), the number of ways to choose k items from n, equal to n! ÷ (k! × (n − k)!). It fills the triangle.
Row (n)
A horizontal line of the triangle. The top single 1 is row 0, so row n contains n + 1 entries.
Binomial expansion
Writing out (a + b) raised to a power. The coefficients of the terms are exactly the entries of row n of the triangle.
Factorial (n!)
The product of all whole numbers from 1 to n, with 0! defined as 1. It appears in the C(n, k) formula.

Frequently asked questions

What is Pascal's triangle?

Pascal's triangle is a triangular array of numbers. The top is a single 1 (row 0), each row begins and ends with 1, and every other number is the sum of the two numbers directly above it. The entries are the binomial coefficients C(n, k).

How do you build each row?

Start a new row with 1. For each inner position, add the two numbers immediately above it (one up-left, one up-right). End the row with 1. For example, row 3 is 1 3 3 1, so row 4 becomes 1, then 1+3=4, then 3+3=6, then 3+1=4, then 1, giving 1 4 6 4 1.

How are the entries related to binomial coefficients?

The number in row n at position k (both counted from 0) is exactly C(n, k) = n! ÷ (k! × (n − k)!). It counts the ways to choose k items from n and is the coefficient of the matching term when you expand (a + b) to the n power.

Why does each row add up to a power of 2?

Row n sums to 2 to the power n because the sum of all C(n, k) over k equals 2 to the n. Intuitively, choosing any subset of n items (including none or all) gives 2 to the n subsets, and the triangle counts those subsets by size.

Why is the triangle symmetric?

Each row reads the same left to right as right to left because C(n, k) = C(n, n − k). Choosing k items to take is the same as choosing the n − k items to leave behind, so the two counts are always equal.

How many rows can this generator show?

You can generate from 1 up to 25 rows. The cap keeps the centered triangle readable on screen, since the numbers in lower rows grow large. All rows are computed exactly using big integers, so even the largest entries are precise.