🧩Pascal's Triangle Generator

Build the triangle, row sums and C(n, k) from a row count

How to use the Pascal's triangle generator

Pascal’s triangle lays out the binomial coefficients C(n, k) in a triangle. Enter how many rows you want and this generator builds the whole triangle from row 0, shows every row in a scrollable table, and reports each row sum together with the total number of terms.

Instead of adding numbers by hand, you can use the lookup fields to name a row n and a term k and read C(n, k) straight away. The symmetric value C(n, n−k) is printed beside it, so a value you worked out yourself can be checked instantly.

Every row sum is a power of two, and each inner entry is the sum of the two entries above it. The generator uses exactly that addition rule rather than factorials, which keeps the values exact and avoids the rounding error a factorial formula would introduce.

The row count is capped at 40 rows. Binomial coefficients grow very quickly, and that cap keeps every printed value inside the range JavaScript stores exactly; the cap and the safe-integer limit are shown under Limits in use. Decimal or non-integer input triggers a message instead of a silent result, and the single-term lookup accepts rows up to n = 50.

Frequently Asked Questions

How is Pascal’s triangle built?

Both ends of every row are 1, and each inner number is the sum of the two numbers above it. That makes the k-th entry of row n equal to the binomial coefficient C(n, k).

Why is each row sum a power of 2?

Adding up row n is the same as expanding (1+1) to the n-th power with the binomial theorem, so the sum is always 2ⁿ. The calculator prints that sum next to every row.

Why is the number of rows capped?

Binomial coefficients grow very fast. The limit of 40 rows keeps every value inside the range JavaScript can represent exactly (9,007,199,254,740,991).