Pascal's Triangle Calculator
Generate Pascal's triangle up to n rows
Enter the number of rows
Input how many rows of Pascal's triangle you want to generate. The calculator supports up to 20 rows.
Click Generate
The calculator will build Pascal's triangle row by row, starting with a single 1 at the top.
View and use the results
Each row shows the binomial coefficients. Use these for probability calculations, combinatorics, or algebraic expansions.
| Row (n) | Coefficients | Sum of Row | Binomial Form |
|---|---|---|---|
| 0 | 1 | 1 | (a+b)⁰ |
| 1 | 1 1 | 2 | (a+b)¹ |
| 2 | 1 2 1 | 4 | (a+b)² |
| 3 | 1 3 3 1 | 8 | (a+b)³ |
| 4 | 1 4 6 4 1 | 16 | (a+b)⁴ |
| 5 | 1 5 10 10 5 1 | 32 | (a+b)⁵ |
| 6 | 1 6 15 20 15 6 1 | 64 | (a+b)⁶ |
| 7 | 1 7 21 35 35 21 7 1 | 128 | (a+b)⁷ |
| 8 | 1 8 28 56 70 56 28 8 1 | 256 | (a+b)⁸ |
| 9 | 1 9 36 84 126 126 84 36 9 1 | 512 | (a+b)⁹ |
What Is Pascal's Triangle?
Pascal's triangle is a triangular arrangement of numbers where each number is the sum of the two numbers directly above it. The triangle starts with a single 1 at the top. Each row begins and ends with 1. Despite its name, the pattern was known to mathematicians in Persia, China, and India centuries before Blaise Pascal studied it in the 1600s.
How to Build the Triangle
Start with 1 at the top (row 0). Row 1 has two 1s. For each new row, add adjacent pairs from the row above. If there's no neighbor on one side, treat it as 0. So row 2 becomes: 1, (1+1)=2, 1. Row 3: 1, (1+2)=3, (2+1)=3, 1. This simple rule generates the entire triangle.
Connection to Binomial Expansion
The numbers in row n give the coefficients when expanding (a + b)ⁿ. For example, (a + b)³ = 1a³ + 3a²b + 3ab² + 1b³. The coefficients 1, 3, 3, 1 come directly from row 3 of Pascal's triangle. This makes the triangle invaluable for algebra.
Patterns Hidden in the Triangle
Pascal's triangle contains many surprising patterns. The diagonals give counting numbers, triangular numbers, and tetrahedral numbers. The sum of row n equals 2ⁿ. Shallow diagonals sum to Fibonacci numbers. Color odd numbers one color and even numbers another to reveal the Sierpinski triangle fractal.
Combinatorics
The entry in row n, position k equals "n choose k" — the number of ways to select k items from n items.
Probability Theory
Row n gives the probabilities for n coin flips. Row 4 (1, 4, 6, 4, 1) divided by 16 gives probabilities for 0, 1, 2, 3, 4 heads.
Algebra
Use row n coefficients to expand (x + y)ⁿ without multiplying everything out by hand.
Computer Science
Pascal's triangle appears in algorithms for computing combinations and in understanding recursion patterns.