Pascal’s Triangle Generator (Build 1–20 Rows)

JJ Ben-Joseph headshot JJ Ben-Joseph

Quick start

What is Pascal’s Triangle?

Pascal’s Triangle is an infinite triangular array of integers built from a simple rule: every row starts and ends with 1, and each interior value equals the sum of the two values directly above it. Although it is commonly associated with Blaise Pascal (17th century), versions of the triangle appeared much earlier in several mathematical traditions.

The triangle is more than a curiosity: it is a compact “index” of binomial coefficients (combinations), and it also reveals patterns connected to algebra (binomial expansion), probability (binomial distribution), and number theory (divisibility and modular patterns).

How the triangle is constructed (rule)

If we count rows starting at 0 (top row is row 0), the value in row n and position k (starting at 0) is traditionally written as:

P n,k = P n1,k1 + P n1,k

with boundary values:

This generator uses that exact addition rule, building each row from the row before it.

Connection to binomial coefficients (combinations)

Every entry in Pascal’s Triangle is a binomial coefficient:

Pn,k = ( n k ) = n! k!(nk)!

Interpretation: (n choose k) counts how many ways to choose k items from n items without order.

When using this page, remember the UI asks for a number of rows starting from the top. If you generate R rows, you are producing rows n = 0 through n = R − 1 in the 0-based binomial-coefficient convention.

How to interpret the output

Worked example (Rows = 5)

If you enter Rows = 5, the generator outputs 5 rows:

1
1 1
1 2 1
1 3 3 1
1 4 6 4 1

These correspond to n = 0..4. Now connect this to the binomial theorem. The coefficients in the expansion of (a + b)^4 are:

(a + b)^4 = 1·a^4 + 4·a^3b + 6·a^2b^2 + 4·ab^3 + 1·b^4

Those coefficients (1, 4, 6, 4, 1) match the last generated row above. In general, the coefficients of (a + b)^n are the numbers in row n of Pascal’s Triangle (with the top row as n = 0).

Common patterns you can spot quickly

Pascal’s Triangle contains many well-known patterns. Here are a few that are easy to verify with small row counts:

Pascal’s Triangle vs. “nCr” calculators

Tool Best for Output Typical question
Pascal’s Triangle generator (this page) Seeing many coefficients at once and spotting patterns A whole table of rows “What are all coefficients for (a+b)^n?”
Combination / nCr calculator Computing one specific coefficient precisely A single value (n choose k) “How many ways to choose k from n?”
Binomial distribution calculator Probability questions with repeated trials Probabilities, CDF/PMF “What is P(X = k) for n trials?”

Limitations & assumptions

If you want to compute a single coefficient or use these values in probability, you may also like a combinations (nCr) tool and a binomial distribution calculator.

Pascal's Triangle settings

Generates rows starting at 1 (top). Example: 5 rows ends with 1 4 6 4 1.

Enter how many rows you would like to generate.

Embed this calculator

Copy and paste the HTML below to add the Pascal’s Triangle Generator (1–20 Rows) + Copyable Table to your website.