Math calculator

Pascal’s Triangle Calculator

One rule — add the two above — and most of combinatorics falls out.

The triangle, to any row

Each entry is the two above it, added.

Row 8

1, 8, 28, 56, 70, 56, 28, 8, 1

These are the coefficients of (a + b)^8, in order. They add to 256, which is 2^8.

Entries in the row

9

row 8 has 8 + 1

Row sum

256

= 2^8

Largest entry

70

the middle one, always

Total entries drawn

45

a triangular number itself

Rows 0 to 8

1
11
121
1331
14641
15101051
1615201561
172135352171
18285670562881

Every entry is the sum of the two directly above it, and the edges are 1 because there is only one number above them. That single rule generates the binomial coefficients, the triangular numbers and the powers of two all at once.

  • Row 8 sums to 256, which is 2^8 — every row doubles the one above it, because each entry feeds two entries below.
  • The entries of row 8 are the coefficients of (a + b)^8, in order.
  • Reading down the second diagonal gives the counting numbers and the third gives the triangular numbers, which is the same statement as C(n, 2) = n(n−1)/2.

Built by the multiplicative recurrence on arbitrary-precision integers, so row 40’s twelve-digit middle entry is exact.

What this tool shows

Every entry is the sum of the two directly above it. That single rule produces the binomial coefficients, the triangular numbers, the powers of two, and the Fibonacci numbers — which is why row 4 being 1, 4, 6, 4, 1 tells you (a + b)⁴ before you multiply anything.

  • Pascal’s triangle to any row up to 40
  • The binomial coefficients of that row
  • The row sum, and why it is a power of two
  • The largest entry in the row
  • What each diagonal counts
  • The identity behind each entry
Drawn, not tabulated Exact big integers Row sums are powers of two The diagonals explained

Exact integers, to row 40.

Updated 7 September 2026 · Works in any browser, no installation

Start each row with 1, end it with 1, and make every entry in between the sum of the two directly above it. Row 4 is 1, 4, 6, 4, 1 — and those are exactly the coefficients of (a + b)⁴ = a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴.

At a glance

Formula shown
Each entry is C(n, k) = n! / (k!(n \u2212 k)!), and the triangle\u2019s rule C(n, k) = C(n\u22121, k\u22121) + C(n\u22121, k) is what makes it buildable without factorials. Row n sums to 2\u207f and is symmetric, since C(n, k) = C(n, n \u2212 k).
Scenario support
Expanding a binomial without multiplying it out; reading off how many ways k things can be chosen from n; checking a combinatorics answer against the triangle.
Educational estimate
Planning support from the values you enter — not professional advice.

The rows are binomial coefficients

Multiply out (a + b)³ and you get a³ + 3a²b + 3ab² + b³. The coefficients are 1, 3, 3, 1, which is row 3.

This is not a coincidence, and the reason is a counting argument. Expanding (a + b)ⁿ means choosing, from each of the n brackets, either an a or a b. The coefficient of aⁿ⁻ᵌbᵌ is the number of ways to choose which k brackets contribute the b — which is C(n, k).

So the triangle is a table of “how many ways to choose k things from n”, and the binomial theorem is that table read as coefficients. Row 5 says there are 10 ways to choose 2 things from 5, and it says the coefficient of a³b² is 10, and these are the same statement.

Why every row doubles

Row 0 sums to 1, row 1 to 2, row 2 to 4, row 3 to 8. Row n sums to 2ⁿ, always.

The reason is in the construction. Every entry contributes to exactly two entries in the row below — the one down-left and the one down-right — so the total doubles at every step.

There is a counting reading too. The row sum counts all the subsets of an n-element set: choose none, choose one, choose two, and so on. A set of n things has 2ⁿ subsets, because each element is either in or out. The triangle sorts those subsets by size.

Substituting a = b = 1 into the binomial theorem says the same thing in one line: (1 + 1)ⁿ = 2ⁿ is the sum of the row.

What the diagonals count

First diagonal: all 1s. There is exactly one way to choose nothing.

Second: 1, 2, 3, 4, 5 — the counting numbers. There are n ways to choose one thing from n.

Third: 1, 3, 6, 10, 15 — the triangular numbers. There are n(n−1)/2 ways to choose two things from n, which is also how many handshakes happen in a room of n people.

Fourth: 1, 4, 10, 20, 35 — the tetrahedral numbers, counting the ways to choose three.

There is also the hockey-stick identity: add any diagonal run and the total appears just below and to the side of where you stopped. 1 + 3 + 6 + 10 = 20, and 20 sits at the end of the hook.

Fibonacci hides in it

Read the triangle along its shallow diagonals — not straight down, but at a gentler slope — and each one sums to a Fibonacci number.

1. Then 1. Then 1 + 1 = 2. Then 1 + 2 = 3. Then 1 + 3 + 1 = 5. Then 1 + 4 + 3 = 8. The Fibonacci sequence, from a triangle that was built to count subsets.

The reason is a counting one, as usual: the number of ways to tile a strip of length n with squares and dominoes is F(n+1), and sorting those tilings by how many dominoes they use gives exactly the binomial coefficients along one shallow diagonal.

Counting with it

Committees. How many ways to pick 3 people from 7? Row 7, entry 3 (counting the first as entry 0): 35.

Coin flips. Flip a coin 5 times: row 5 is 1, 5, 10, 10, 5, 1, so there is 1 way to get no heads, 5 ways to get one, 10 ways to get two. Divide by the row sum of 32 and you have the probabilities.

Paths on a grid. The number of shortest routes to a point on a lattice is the entry at that position, for the same reason the triangle is built the way it is: you arrive from one of two places.

The symmetry. C(n, k) = C(n, n−k), so every row reads the same backwards. Choosing 3 people to include is the same as choosing 4 to leave out.

Its history

Pascal wrote about it in 1654, and the name stuck in the West. He was several centuries late.

The Persian mathematician Al-Karaji described it around 1000 CE, and Omar Khayyam worked with it shortly after — it is still called the Khayyam triangle in Iran. In China, Jia Xian had it by about 1100 and Yang Hui published it in 1261, which is why it is Yang Hui’s triangle there. Indian scholars knew the underlying combinatorics earlier still, in Pingala’s work on prosody.

What Pascal added was the systematic treatment, and the connection to probability that he developed with Fermat. The triangle was old; using it to reason about chance was not.

Sources and methodology

The triangle is standard, and its history is genuinely older than the name; these are the references.

Method. Each row is built from the one above by the multiplicative recurrence C(n, k) = C(n, k−1)(n − k + 1)/k on arbitrary-precision integers, which never forms a factorial and never divides inexactly — every intermediate is itself a binomial coefficient. The suite checks all 351 entries up to row 25 against the factorial definition computed separately, and asserts that every row to 40 sums to exactly 2ⁿ and that each entry equals the two above it. That engine is verified on every change against 76 hand-written assertions, including that every entry to row 40 equals the sum of the two above it and every row sums to exactly 2ⁿ — a pair of checks an arithmetic slip anywhere in the triangle would fail. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Binomial Coefficientn choose k exactly on big integers, by the multiplicative formula that divides as it goes and never builds a factorial — with Pascal's rule and permutations beside it.
FactorialFactorials with every digit exact — 100 factorial is 158 of them — plus the trailing-zero count derived from Legendre's formula and Stirling's error.
FibonacciEvery digit of F(n), not a rounded double — a JavaScript number stops being exact at F(79), and F(80) is where most web calculators quietly go wrong.
SubsetTest whether one set is a subset, a proper subset, equal or disjoint — and when the answer is no, name the exact element that breaks it.
Power SetList all 2^n subsets with the binary word that generates each one, grouped by size and checked against the binomial coefficients, with the element-versus-subset distinction spelled out.
Nth TermGive it the terms and it finds the rule — arithmetic, geometric, quadratic or Fibonacci-like — with the difference table, and an honest 'no rule found' when there is none.

More in Math, or browse all calculators.

Read the guide

For a single coefficient at a row far past 40, the Binomial Coefficient Calculator computes C(n, k) directly. The shallow diagonals of this triangle sum to the Fibonacci numbers, which the Fibonacci Calculator takes further.

Educational use disclaimer

This is an educational tool. The entries are exact integers; the page draws up to row 40 because past that a row no longer fits on a screen, not because the arithmetic runs out.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (3 updates)

Published 7 September 2026

  1. Published Pascal's triangle drawn rather than tabulated, because the thing worth seeing is that each entry sits under the two that made it.
  2. Rows are built by the multiplicative recurrence on big integers, so no factorial is ever formed and every intermediate is itself a binomial coefficient.
  3. The history is given accurately: Al-Karaji had it around 1000 CE and Yang Hui published it in 1261, so Pascal was several centuries late to a triangle that carries his name in the West.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.