Pascal's triangle generator

Each number in Pascal’s triangle is the sum of the two above it, and row n gives the coefficients of (a + b)^n.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter number of rows.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Entry k of row n is C(n, k) = n! ÷ (k! × (n - k)!), with C(n, k) = C(n - 1, k - 1) + C(n - 1, k). Row n sums to 2^n.

Example

Inputs: Number of rows = 6. Result: Pascal's triangle: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1; Sum of the last row: 32.

Limits and caveats

  • Limited to 30 rows so the triangle stays readable; for later rows use the combination calculator.

Questions about this tool

How do I expand (a + b)^4 with it?

Row 4 is 1 4 6 4 1, so (a + b)^4 = a^4 + 4a^3b + 6a^2b^2 + 4ab^3 + b^4.

Why do rows start at 0?

The top row 1 stands for (a + b)^0 = 1, so the row number matches the exponent.

How does it relate to probability?

Row n divided by 2^n gives the chances of each number of heads in n fair coin flips.