Pascal's Triangle Calculator - Build Rows & Read Entries

Row 0 is the single 1 at the top, so 9 rows ends at row 8.

Tap any number to see the two entries it came from.

Rows 0 to 8 · 45 entries · largest is 70

Row 5, position 2

C(5, 2) = 10

Built from the two entries above it: 4 + 6 = 10. Those two are highlighted in the triangle.

Row 5 adds up to 25 = 32, so this entry is 31.25% of its row — the chance of getting exactly 2 heads in 5 coin flips.

How to Use This Calculator

  1. Pick a job with the three buttons at the top. Build the triangle draws it, One entry + its row answers a single C(n, k), and Binomial expansion turns a row into algebra.
  2. In the triangle view, set Rows to build and tap any number. The two entries that produced it light up, and the panel underneath shows the addition.
  3. Switch How to draw it to Colour by remainder and push the rows to 32 or 64. At mod 2 the even entries fall away and Sierpinski’s triangle appears — the same shape at every scale.
  4. For a single value, enter n (the row) and k (the position, counting from 0). Both count from zero, so the 5th entry of row 10 is k = 4, not 5.
  5. In the expansion tab, set a, b and n, then read the Coefficient column for the term you were asked about. A negative b flips the signs to alternate.

Share this calculator

Help others solve their calculations

Found this calculator helpful? Share it with your friends, students, or colleagues who might need it!

Pascal’s Triangle Calculator: Every Pattern Hiding in the Rows

About the Author

Marko Šinko - Co-Founder & Lead Developer

Marko Šinko

Co-Founder & Lead Developer, AI Math Calculator

Lepoglava, Croatia
Advanced Algorithm Expert

Croatian developer with a Computer Science degree from University of Zagreb and expertise in advanced algorithms. Co-founder of award-winning projects, ensuring precise mathematical computations and reliable calculator tools.

📅 Published:
Pascal's Triangle Calculator showing seven rows of hexagonal tiles, with two adjacent entries adding to the tile directly beneath them

A Pascal’s triangle calculator earns its keep on row 30, not row 5. Anyone can add 1 2 1 into 1 3 3 1 on paper. Nobody wants to write out 496 numbers by hand to find out that C(31, 15) = 300,540,195 — and if you try it in a spreadsheet, the answer will quietly stop being exact somewhere around row 57.

The triangle is a stack of rows where each entry is the sum of the two directly above it. That one rule generates the binomial coefficients, the coin-flip probabilities, the triangular numbers, the Fibonacci sequence and a fractal — all from adding pairs of numbers. What follows is a tour of what is actually in there, with the numbers to check each claim.

Rows and Positions Both Start at Zero — and That Trips Everyone

The single 1 at the top is row 0. The row 1 1 is row 1. Within a row, the leftmost entry is position 0. So the entry written C(n, k) — spoken “n choose k” — sits in row n at position k, and the fourth number along row 6 is C(6, 3) = 20, not C(6, 4).

This is the single most common source of an off-by-one answer in the whole topic, and it shows up in textbooks too: some older sources number the top row as row 1. Two facts settle any dispute instantly. Row n always contains exactly n + 1 entries, and row n always sums to 2ⁿ. If your row of five numbers sums to 16, it is row 4.

The first eight rows of Pascal’s triangle with their totals
Row nEntriesCountSum = 2ⁿ
0111
11 122
21 2 134
31 3 3 148
41 4 6 4 1516
51 5 10 10 5 1632
61 6 15 20 15 6 1764
71 7 21 35 35 21 7 18128

Two Rules Reach the Same Number, and Only One of Them Scales

The addition rule, C(n, k) = C(n−1, k−1) + C(n−1, k), is what the picture is. It is also hopeless past a certain depth. Getting to row 500 by addition means computing 125,751 entries first. The multiplicative rule gets there in 250 steps:

C(n, k) = (n × (n−1) × … × (n−k+1)) ÷ (1 × 2 × … × k)

Take C(10, 3). Multiply 10 × 9 × 8 = 720, divide by 1 × 2 × 3 = 6, and the answer is 120. Note what did not happen: 10! = 3,628,800 was never computed. The textbook form n!/(k!(n−k)!) is correct but wasteful — it builds two enormous numbers and then cancels almost all of them away. Try C(52, 5) through factorials and you are handling a 68-digit number to get a 7-digit answer. Through the multiplicative rule it is 52 × 51 × 50 × 49 × 48 ÷ 120 = 2,598,960, and nothing along the way is bigger than the result.

Symmetry cuts the work again. C(n, k) = C(n, n−k), because choosing which 47 cards to leave in the deck is the same act as choosing which 5 to deal. So C(52, 47) needs five multiplications, not forty-seven. A factorial calculator is still the right tool when the factorial itself is the answer — just not as a route to a binomial coefficient.

Every Row Is a Coin-Flip Distribution Waiting for a Denominator

Divide any row by its own total and you have the exact probabilities for that many fair coin flips. Row 10 is 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1 and sums to 1,024. So ten flips give exactly five heads with probability 252/1024 = 24.6%.

That number surprises people. Five heads out of ten is the most likely single outcome, and it still happens less than a quarter of the time. Push it further and the effect sharpens: with 100 flips, exactly 50 heads has probability 7.96%, and by 1,000 flips it is down to 2.5%. The peak keeps thinning because the row keeps widening, even as the results stay clustered near the middle. The bar chart in the calculator makes the shape obvious — it is a normal curve, drawn by nothing more than repeated addition.

Attach unequal probabilities and the same coefficients drive the binomial probability calculator: P(exactly k) = C(n, k) · pᵏ · (1−p)ⁿ⁻ᵏ. Pascal’s triangle is that formula with p = 0.5, which is why the row is symmetric only for a fair coin.

Read It Sideways and Familiar Sequences Fall Out

The diagonals are where the triangle stops being a lookup table and starts being interesting. Counting from the outside edge inward:

What each diagonal of Pascal’s triangle contains
DiagonalFirst termsWhat they are
k = 01, 1, 1, 1, 1…The outer edge — one way to choose nothing
k = 11, 2, 3, 4, 5…The counting numbers
k = 21, 3, 6, 10, 15…Triangular numbers — handshakes among n people
k = 31, 4, 10, 20, 35…Tetrahedral numbers — stacked cannonballs
shallow ↗1, 1, 2, 3, 5, 8, 13…Fibonacci, summed along shallow diagonals

The Fibonacci one is worth doing by hand once. Tilt your gaze and add along shallow diagonals: 1; 1; 1+1; 1+2; 1+3+1; 1+4+3 — giving 1, 1, 2, 3, 5, 8. The same numbers a Fibonacci calculator produces from a completely different recurrence are sitting inside a triangle built only from pairwise sums. The k = 2 diagonal is equally concrete: C(n, 2) counts handshakes, so eight people at a table make C(8, 2) = 28 of them, which is also the seventh triangular number.

Then there is the hockey stick. Add any run down a diagonal starting at an edge 1, and the total is the entry diagonally below where you stopped. Down the k = 2 diagonal: 1 + 3 + 6 + 10 + 15 = 35 = C(7, 3). Draw it on the triangle and the shape is a hockey stick — a straight shaft with the answer as the blade.

Colour the Odd Numbers and a Fractal Appears

Ignore the values entirely. Shade every odd entry and leave the even ones blank, and Sierpiński’s triangle emerges — the same triangular hole pattern repeating at every scale. Take the calculator to 64 rows in Colour by remainder mode and watch it build.

This is not decoration; it is a theorem you can see. Kummer’s result says the power of a prime p dividing C(n, k) equals the number of carries when k and n−k are added in base p. For p = 2, C(n, k) is odd exactly when adding k and n−k in binary produces no carries at all — which happens only when the binary digits of k are a subset of the binary digits of n. Row 63 is 111111 in binary, so every one of its 64 entries is odd, and that row draws as a solid line. Row 64 is 1000000, so only two entries are odd, and the pattern collapses to a pair of points.

Switch the modulus to 3, 5 or 7 and a different fractal appears with a different hole size, because the same carry rule applies in base 3, 5 and 7. Around 65% of the entries in the first 64 rows are even; push to 256 rows and the proportion of odd entries keeps falling toward zero. Most of Pascal’s triangle, in the long run, is even.

Why a Pascal’s Triangle Calculator Switches to Big Integers at Row 57

Standard floating-point arithmetic holds integers exactly only up to 2⁵³ = 9,007,199,254,740,992. Every entry in row 56 clears that bar — the biggest, C(56, 28), is 7,648,690,600,760,440. Row 57 does not: C(57, 25) = 9,929,472,283,517,787 is the first binomial coefficient anywhere in the triangle to pass it. From there on, a spreadsheet or a JavaScript calculator using ordinary numbers returns something that looks right — correct leading digits, correct magnitude — and is wrong in the last few places. No error, no warning.

That is why this tool holds every value as an arbitrary-precision integer. C(100, 50) is 100,891,344,545,564,193,334,812,497,256 — thirty digits, all of them exact. The related trap is the factorial route: computing C(60, 30) as 60!/(30!·30!) means forming an 82-digit number first, and any implementation that does that in floating point loses the answer entirely.

Two habits keep you honest. Check that your row sums to 2ⁿ, and check that the row reads the same backwards. Both fail loudly the moment precision slips.

Triangle, Combination or Permutation — Picking the Right One

These questions all touch C(n, k), but they want different things on screen. The distinction is worth getting right before you start typing numbers.

  • You need the picture, a whole row, or a pattern. Stay here. The triangle view, the row list and the remainder colouring are what this page is for.
  • You need one “how many ways to choose k from n” answer. The combination calculator and the nCr calculator are built for exactly that question and nothing else.
  • Order matters — medals, passwords, seating. That is nPr, not nCr, and it is always larger by a factor of k!. C(5, 3) = 10 committees, but P(5, 3) = 60 podium finishes. Use the permutation calculator.
  • You need the algebra, not the count. Expanding (2x − 3)⁴ uses row 4 as its coefficients; the expansion tab above does it, and the binomial theorem calculator covers the general statement.

One worked case to tie it together. “In how many ways can a 5-person committee be chosen from 12, and what is the coefficient of x⁵ in (1 + x)¹²?” Both answers are 792, and they are the same question asked twice — position 5 of row 12. That equivalence is the whole reason the triangle keeps turning up in combinatorics and in algebra at the same time. For the historical record — Pingala in India, Al-Karaji in Baghdad and Yang Hui in China all had it centuries before Pascal — the Wikipedia entry on Pascal’s triangle traces the full lineage.

Frequently Asked Questions

Still Have Questions?

The detailed content on this page provides comprehensive explanations and examples to help you understand better.