StatGardenREF. DESK
Calculators/Maths/Pascal's Triangle
Maths

Pascal's Triangle calculator

Generates any row of Pascal's triangle as binomial coefficients, with the surrounding rows shown for context.

Published 21 August 2026

What this calculator does

Pascal's triangle is the triangular arrangement of numbers where each entry is the sum of the two entries above it, starting from a single 1 at the top. This Pascal's triangle calculator skips the row-by-row addition and generates any row directly from its position, using the binomial coefficient formula, which gives exactly the same numbers without needing every row above it first.

Each entry in row n is the binomial coefficient C(n, k), the number of ways to choose k items from a set of n, for k running from 0 to n. That is why the triangle shows up everywhere from binomial expansion (the coefficients of (x + y)ⁿ) to probability and combinatorics: it is really a table of combinations laid out by row and position, not a separate pattern of its own.

The formula

FormulaRow n, position k = C(n,k) = n! ÷ (k!(n−k)!), for k = 0 to n

Enter a row number, counting from row 0 at the top. The calculator computes C(n, k) for every position k in that row using the factorial-based combination formula, then sums the row (which always equals 2ⁿ) and reports the largest entry. A context table below the result shows every row from 0 up to the one requested, so the pattern of how each row builds from the last is visible alongside the specific row asked for.

TermMeaning
nThe row number, counting from 0 at the top of the triangle.
kThe position within the row, also counting from 0 on the left.
C(n, k)The binomial coefficient, read as "n choose k": the number of ways to pick k items from a set of n, equal to n! ÷ (k!(n − k)!).

The inputs explained

FieldWhat to enter
Row number (row 0 is the top)The row number to generate, starting at 0 for the single-entry top row. Rows above 60 are rejected, since the values quickly exceed what ordinary number precision can represent exactly.

When to use it

Binomial expansion

The coefficients in the expansion of (x + y)ⁿ are exactly row n of Pascal's triangle, in order, so generating the row directly gives the expansion coefficients without multiplying out the brackets by hand.

Combinatorics and probability problems

Any calculation of "n choose k" is a single entry in row n of the triangle. Generating the whole row at once is useful when a problem needs several different k values from the same n.

Checking a triangle built by hand

Building Pascal's triangle row by row by adding adjacent pairs is a common exercise, and a single arithmetic slip early on throws off every row after it. Generating a row independently, straight from the formula, is a quick way to check where a hand-built triangle went wrong.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

What do the first several rows of Pascal's triangle look like?

The row requested, alongside every row from the top down to it, generated the same way.

Rows 0 to 10
Row requestedNumber of entries in the rowSum of the row (2^n)
4516
6764
89256
10111,024
Each row has one more entry than the last, and the sum of any row is always exactly 2 raised to the row number, since that sum counts every possible subset of an n-element set.

Questions

Why does row n have n + 1 entries, not n?

Counting starts at position 0, so a row with entries for k = 0 through k = n has n + 1 entries in total. Row 0 has one entry (just 1), row 1 has two entries (1, 1), and so on.

What is the fastest way to generate a row without adding the row above it?

Each entry is a binomial coefficient C(n, k), computable directly from n and k with the factorial formula C(n, k) = n! ÷ (k!(n − k)!), which is exactly what this calculator does, skipping the addition entirely.

Why does the sum of a row always come out as a power of 2?

The sum of row n counts every possible subset of an n-element set, since each entry C(n, k) counts the subsets of exactly size k. There are 2ⁿ subsets of an n-element set in total, which is why the row sum is always 2ⁿ.

Is this the same calculation as combinations elsewhere on the site?

Yes. Each entry in row n, position k, is exactly the value nCr(n, k) used in standard combinatorics: the number of ways to choose k items from n without regard to order.

For a single combination value rather than a whole row, most scientific calculators and spreadsheet functions compute nCr(n, k) directly. To convert the coefficients into an actual binomial expansion, pair each entry with the matching power of x and y.