Pascal's Triangle Calculator - Generate Binomial Coefficients

Generate rows of Pascal's triangle, calculate individual binomial coefficients, and explore combinatorial patterns — choose the number of rows and display format.

Enter the number of rows to generate (1–20) and optionally a specific row number to highlight. Choose triangular or linear display format.

Pascal's Triangle Calculator - Generate Binomial Coefficients
Generate rows of Pascal's triangle, calculate individual binomial coefficients, and explore combinatorial patterns — choose the number of rows and display format.

Enter a positive integer between 1 and 20

Leave empty to generate all rows up to the number specified above

About Pascal's Triangle Calculator

Pascal's triangle is one of the most celebrated structures in mathematics. It is a triangular array of numbers where each entry is the sum of the two entries directly above it in the preceding row. The triangle begins with a single 1 at the apex (row 0), and each subsequent row is constructed by adding adjacent pairs. Row 1 is [1, 1]; row 2 is [1, 2, 1]; row 3 is [1, 3, 3, 1]; row 4 is [1, 4, 6, 4, 1], and so on. Each entry in the triangle is a binomial coefficient, written C(n, k) or \"n choose k\", defined as n! / (k! × (n−k)!). The entry in row n at position k (counting from 0) equals C(n, k) — the number of ways to choose k items from a set of n items without regard to order. This connection to combinatorics makes Pascal's triangle a compact lookup table for combinatorial counts and a fundamental tool in probability theory. In algebra, the binomial theorem states that (a + b)ⁿ = Σ C(n,k) aⁿ⁻ᵏ bᵏ for k from 0 to n. The coefficients of this expansion are exactly the entries in row n of Pascal's triangle. Expanding (x + 1)⁵ gives coefficients 1, 5, 10, 10, 5, 1 — precisely row 5. This makes Pascal's triangle an indispensable shortcut for polynomial expansions and for computing probabilities in binomial distributions. The triangle contains an astonishing number of hidden patterns. The shallow diagonals sum to Fibonacci numbers. The rows give the powers of 11: row 0 is 1, row 1 is 11, row 2 is 121, row 3 is 1331, row 4 is 14641. The hockey stick identity states that the sum of a diagonal of entries equals the entry one step below the end of the diagonal. Coloring entries odd or even produces the fractal pattern known as the Sierpiński triangle. Beyond pure mathematics, Pascal's triangle appears in probability (binomial and negative binomial distributions), in combinatorics (lattice paths, subsets, combinations with repetition), in number theory (prime rows whose non-edge entries are all divisible by the row number), in computer science (dynamic programming algorithms for combinations), and in financial mathematics (binomial option pricing models). The calculator allows you to generate up to 20 rows instantly, highlight any specific row, and toggle between triangular and linear display so you can study the structure at whatever level of detail you need.

Pascal's Triangle Examples

Common scenarios demonstrating row generation, specific rows, and binomial coefficient lookup.

InputOutput / Row valuesApplication
First 5 rows, triangular format[1] [1,1] [1,2,1] [1,3,3,1] [1,4,6,4,1]Each row n contains the binomial coefficients C(n,0) through C(n,n).
Row 4 only (linear format)1, 4, 6, 4, 1These are the coefficients of (a+b)⁴ = a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴.
First 8 rows, triangular formatRows 0–7 displayed as triangleSum of row n equals 2ⁿ. Row 7 sums to 128 = 2⁷.
Row 6 with calculations1, 6, 15, 20, 15, 6, 1C(6,3)=20 is the number of ways to choose 3 items from 6. Used in probability and combinations.

How to Use the Pascal's Triangle Calculator

  1. Enter the number of rows to generate (between 1 and 20) in the Number of Rows field.
  2. Optionally enter a specific row number in the Specific Row field to highlight just that row's coefficients.
  3. Choose the display format: Triangular shows the classic pyramid layout; Linear lists the coefficients of a single row flat.
  4. Click Generate Triangle. The calculator builds the triangle and displays all rows with their coefficients.
  5. Click Reset Calculator to clear all fields and start a new calculation.

Pascal's Triangle FAQ

What is Pascal's triangle?
Pascal's triangle is a triangular array where each entry is the sum of the two entries directly above it. The entries are the binomial coefficients C(n, k), making the triangle a compact lookup table for combinations and the coefficients of binomial expansions.
How do I find C(n, k) in Pascal's triangle?
Go to row n (counting from row 0 at the top) and select the entry at position k (counting from 0 on the left). For example, C(5, 2) = 10 is the third entry in row 5. The calculator highlights any specific row so you can read off individual binomial coefficients at a glance.
What are the diagonal patterns in Pascal's triangle?
The first diagonal (all 1s) lists counting numbers. The second diagonal lists natural numbers 1, 2, 3, 4, …. The third diagonal lists triangular numbers 1, 3, 6, 10, …. Each diagonal is the partial sums of the previous diagonal, and the Fibonacci numbers appear along the shallow diagonals.
How is Pascal's triangle used in probability?
For a binomial experiment with n trials and success probability p, the probability of exactly k successes is C(n,k) × pᵏ × (1−p)ⁿ⁻ᵏ. The C(n,k) factor comes directly from Pascal's triangle. The triangle also counts the number of paths through a lattice grid, making it useful in random-walk and gambler's ruin problems.
Why does the sum of row n equal 2ⁿ?
The sum C(n,0) + C(n,1) + … + C(n,n) = 2ⁿ because each term counts the number of subsets of a particular size from an n-element set, and the total number of subsets of any set is 2ⁿ. In the binomial theorem, setting a = b = 1 in (a + b)ⁿ gives 2ⁿ directly.
What is the connection between Pascal's triangle and Sierpiński's triangle?
If you colour every odd entry in Pascal's triangle one colour and every even entry another, the resulting pattern converges to the Sierpiński fractal triangle as the number of rows grows. This happens because C(n,k) is odd if and only if, in base 2, k is a bitwise subset of n — a pattern that exactly replicates the self-similar structure of the Sierpiński triangle.