Pascal's Triangle Generator
Build Pascal's triangle row by row — every number is the sum of the two above it. See row sums, binomial coefficients, and the hidden diagonals explained.
How to use this calculator
Type how many rows you want (row 0 through row n − 1) and the calculator builds the triangle by the same additive rule Pascal used: start each row with 1, end it with 1, and fill every spot in between by adding the two numbers sitting directly above it. The answer band shows the last row you asked for, along with its total.
The build rule
Row 0 is just 1. Every later row keeps 1 at both ends, and each interior entry is the sum of the two entries above it:
Six rows built this way look like:
Row 0: 1
Row 1: 1 1
Row 2: 1 2 1
Row 3: 1 3 3 1
Row 4: 1 4 6 4 1
Row 5: 1 5 10 10 5 1
Check row 4's middle entry: , the sum of the two 3s directly above it in row 3.
Row n holds the binomial coefficients
Position of row (both counted from 0) equals — the number of ways to choose items from a set of . Row 4 is , which works out to 1, 4, 6, 4, 1. That is also why every row is symmetric: .
Row sums double every time
Add up any row and you get a power of two: row 4 sums to . Each entry of a row feeds into forming two entries of the next row (one to the left, one to the right), so the row total exactly doubles at every step, starting from row 0's total of 1.
Binomial expansion
The same numbers are the coefficients when you expand . Row 2 gives 1, 2, 1, matching . Row 3 gives 1, 3, 3, 1, matching — the reason this triangle shows up constantly in algebra and probability.
Hidden diagonals
Reading the triangle along its diagonals uncovers other famous sequences:
| Diagonal | Values | Sequence |
|---|---|---|
| 1st (edge) | 1, 1, 1, 1, … | constant |
| 2nd | 1, 2, 3, 4, … | natural numbers |
| 3rd | 1, 3, 6, 10, … | triangular numbers |
| shallow (up-right) | sums to 1, 1, 2, 3, 5, 8, … | Fibonacci numbers |
That last one is the neatest: summing entries along a shallow diagonal — one step left, one step up, repeated — reproduces the Fibonacci sequence, tying this triangle directly to the golden-ratio family of calculators.
Worked example — 6 rows
- Row 0:
1. - Row 1: edges are 1, so
1 1. - Row 2: edges 1, interior →
1 2 1. - Row 3: edges 1, interior and →
1 3 3 1. - Row 4: edges 1, interior , , →
1 4 6 4 1. - Row 5: edges 1, interior , , , →
1 5 10 10 5 1, summing to .
Frequently asked questions
- What is Pascal's triangle?
- Pascal's triangle is a triangular array of numbers where each row starts and ends with 1, and every interior number is the sum of the two numbers directly above it. Row (counting from 0) holds the binomial coefficients through .
- How do you build Pascal's triangle?
- Start row 0 with a single 1. To build the next row, put a 1 at each end, then fill every interior spot by adding the two numbers directly above it. Repeating this rule row after row generates the whole triangle.
- What is the connection between Pascal's triangle and binomial coefficients?
- The -th entry (from 0) of row equals , the number of ways to choose items from . Row 4 is 1, 4, 6, 4, 1 — exactly through .
- Why does every row sum to a power of two?
- Each entry in row is used in forming two entries of row from row (once for the spot to its left-below, once for the spot to its right-below), so the total doubles every row. Row 0 sums to 1, so row sums to .
- What are the diagonals of Pascal's triangle?
- The outermost diagonal is all 1s. The next diagonal in is the natural numbers 1, 2, 3, 4, …. The third diagonal holds the triangular numbers 1, 3, 6, 10, …. Shallow diagonals (running up-right at a gentle slope) sum to the Fibonacci numbers.
- How is Pascal's triangle related to the Fibonacci sequence?
- Adding the entries along a shallow diagonal — one step left and one step up, repeated — produces the Fibonacci sequence. For example the diagonal through row 4's 1, row 3's 3, and row 2's 1 sums to 5, the next Fibonacci number after 3.
- Did Pascal invent this triangle?
- No — versions of the triangle were known centuries earlier in India, Persia, and China. Blaise Pascal's 1654 treatise organized and popularized its properties in the West, which is why it carries his name today.
- How many rows can this calculator build?
- Up to 30 rows. Row 29 already has 30 entries and a row sum of (over 536 million), which is plenty to see every pattern in the triangle clearly.