🔺 Math Calculator

Pascal's Triangle Calculator

Generate the full triangle up to 20 rows, look up any single entry C(n,k), expand binomials instantly, and highlight hidden patterns — all with a color-coded visual triangle and step-by-step working.

🎨 Color-coded visual 📐 Binomial expansion 🔍 Find any C(n,k) ✨ Pattern highlighter

What Is Pascal's Triangle?

Pascal's triangle is one of the most elegant structures in all of mathematics. It's a triangular arrangement of numbers where every number is the sum of the two numbers directly above it. The edges are always 1, and the interior fills in from that single rule.

Named after French mathematician Blaise Pascal (1623–1662), the triangle was actually known much earlier — Chinese mathematician Yang Hui described it in the 13th century, and Indian mathematicians referenced it even earlier. Pascal's contribution was a thorough treatise connecting the triangle to combinatorics, probability, and what we now call the binomial theorem.

Row 0:1
Row 1:11
Row 2:121
Row 3:1331
Row 4:14641
Row 5:15101051

The highlighted number 6 in row 4 means: there are 6 ways to choose 2 items from 4. That single insight connects the triangle to combinations, probability, and algebra simultaneously.

How to Use This Calculator

Most Pascal's triangle tools online either just draw the triangle or only find a single entry. This calculator does three things that competitors don't combine in one place:

🔺

Generate Triangle

Display up to 20 rows of Pascal's triangle with color-coded pattern highlighting. Choose from even/odd coloring, prime number highlighting, Fibonacci diagonal marking, or powers-of-2 display to see the hidden structure inside the numbers.

🔍

Find Any C(n,k)

Enter any row (n) and position (k) — even large values beyond what fits in the visual triangle. The calculator uses the factorial formula directly and shows every step of the working, including the full factorial calculation.

📐

Binomial Expansion

Enter a power n and instantly get the full expansion of (x + y)ⁿ with all coefficients taken from Pascal's triangle. Each term is shown clearly — useful for algebra homework, exam prep, and polynomial problems.

The Formula Behind Pascal's Triangle

Every number in Pascal's triangle can be calculated directly using the binomial coefficient formula:

C(n, k) = n! / (k! × (n − k)!)
n = row number (starting from 0)
k = position in the row (starting from 0)
n! = n factorial = n × (n−1) × (n−2) × … × 1

There's also the recursive definition — each number is the sum of the two directly above it:

C(n, k) = C(n−1, k−1) + C(n−1, k)
With boundary conditions: C(n, 0) = C(n, n) = 1

Both definitions give identical results. The recursive one is intuitive for building the triangle row by row; the factorial formula is better for jumping directly to any entry — which is what the "Find C(n,k)" mode uses.

This is conceptually similar to how our arithmetic sequence calculator offers both a direct formula and a step-by-step build — the direct formula jumps to any term instantly, while the recursive view builds up from scratch.

Hidden Patterns Inside Pascal's Triangle

The more you look at Pascal's triangle, the more structure you find. These patterns are why mathematicians have studied it for centuries — and why teachers use it to make abstract concepts visible.

Powers of 2
The sum of every row equals 2ⁿ. Row 0 = 1, row 1 = 2, row 2 = 4, row 3 = 8, row 4 = 16. This is because each row counts all subsets of an n-element set, and a set with n elements has exactly 2ⁿ subsets.
1 → 2 → 4 → 8 → 16 → 32…
Fibonacci Diagonal
Sum the shallow diagonals running from upper-right to lower-left. The sums give: 1, 1, 2, 3, 5, 8, 13, 21, 34 — the Fibonacci sequence, hidden inside the triangle's structure.
1 | 1 | 1+1 | 1+2 | 1+3+1 | …
Natural Numbers
The second diagonal from the edge contains the natural numbers: 1, 2, 3, 4, 5, 6… The third diagonal contains the triangular numbers: 1, 3, 6, 10, 15, 21… (the sum of the first n natural numbers).
1, 2, 3, 4, 5… and 1, 3, 6, 10, 15…
Prime Rows
If n is prime, every interior number in row n (all except the 1s at the ends) is divisible by n. For row 5: 5, 10, 10, 5 — all divisible by 5. This property is used in number theory proofs.
Row 7: 7, 21, 35, 35, 21, 7 — all divisible by 7
Powers of 11
The first five rows read as single numbers give powers of 11: 1, 11, 121, 1331, 14641. After row 4, digits carry over, but the binomial theorem still connects every row to 11ⁿ.
11⁰=1 · 11¹=11 · 11²=121 · 11³=1331
Sierpiński Triangle
Color all odd numbers one color and even numbers another. The pattern that emerges is the Sierpiński triangle — a famous fractal. This connects number theory, combinatorics, and fractal geometry in one image.
Use Even/Odd highlight in the generator above

Real-World Applications of Pascal's Triangle

Pascal's triangle isn't just a classroom curiosity. It appears across mathematics, statistics, physics, and computer science in practical, useful ways.

🎲
Probability: When flipping a coin n times, row n gives the number of ways each outcome (0 heads, 1 head, 2 heads…) can occur. Dividing by 2ⁿ gives the exact probability. Toss a coin 6 times — row 6 tells you everything.
🧮
Combinations (nCr): Need to know how many ways to choose 3 items from 10? That's C(10,3) = 120, found directly in row 10, position 3 of the triangle. This is foundational for permutations and combinations problems. It also connects naturally to percentage-based probability — which is why our slope percentage calculator shares the same underlying ratio logic.
📊
Binomial distribution: In statistics, the binomial distribution uses Pascal's triangle coefficients to calculate exact probabilities of k successes in n independent trials — used in quality control, genetics, and risk modeling.
💻
Computer science: Pascal's triangle appears in algorithms for combinatorial counting, dynamic programming problems, and cryptography. The recursive structure mirrors memoization patterns used in efficient algorithms.
🧬
Genetics: The probability of inheriting specific gene combinations across generations follows binomial distribution — and therefore Pascal's triangle. Mendel's pea plant experiments can be modeled directly using its rows.
📐
Algebra & calculus: Binomial expansion using Pascal's coefficients is used in polynomial multiplication, derivative rules (like the general Leibniz rule), and Taylor series expansions in calculus. It's a tool that scales from high school to graduate mathematics.

Understanding number patterns in Pascal's triangle also helps with sequences more generally. Our arithmetic sequence calculator covers the linear patterns (constant differences between terms), while Pascal's triangle reveals the deeper combinatorial structure underneath those sequences. And if you've ever written out a large Pascal entry in words for a test or report, our numbers to words converter can handle the conversion instantly.

Worked Examples

Find C(7, 3) — how many ways to choose 3 from 7?
Formula: C(n,k) = n! / (k! × (n−k)!)
C(7,3) = 7! / (3! × 4!)
= 5040 / (6 × 24)
= 5040 / 144
C(7,3) = 35
Expand (x + y)⁴ using Pascal's triangle
Row 4: 1, 4, 6, 4, 1
= 1·x⁴y⁰ + 4·x³y¹ + 6·x²y² + 4·x¹y³ + 1·x⁰y⁴
= x⁴ + 4x³y + 6x²y² + 4xy³ + y⁴
Coin toss probability: 4 tosses, exactly 2 heads
Row 4: 1, 4, 6, 4, 1 — sum = 16 = 2⁴
Ways to get 2 heads = C(4,2) = 6
P(2 heads) = 6 / 16
= 37.5%
Sum of row 6 = ?
Row 6: 1, 6, 15, 20, 15, 6, 1
Sum = 1+6+15+20+15+6+1 = 64
Formula: 2⁶ = 64 ✓
Row sum = 64

Frequently Asked Questions

What is Pascal's triangle?

Pascal's triangle is a triangular arrangement of numbers where each number equals the sum of the two numbers directly above it. The edges are always 1. Every entry in row n and position k equals C(n,k) — the number of ways to choose k items from n. Despite its apparent simplicity, the triangle contains the Fibonacci sequence, powers of 2, triangular numbers, prime row properties, and connections to fractals.

How do you find a specific number in Pascal's triangle?

Use the formula C(n,k) = n! / (k! × (n−k)!), where n is the row number and k is the position (both starting from 0). For example, C(6,2) = 6! / (2! × 4!) = 720 / 48 = 15. You can verify this by looking at row 6: 1, 6, 15, 20, 15, 6, 1 — the number at position 2 is 15. Use the "Find C(n,k)" mode above for larger values.

What is the sum of each row in Pascal's triangle?

The sum of row n equals 2ⁿ. Row 0 = 1, row 1 = 2, row 2 = 4, row 3 = 8, row 4 = 16, and so on. This follows because row n lists all binomial coefficients C(n,0), C(n,1), …, C(n,n), and their sum equals 2ⁿ — the total number of subsets of a set with n elements.

How is Pascal's triangle used for binomial expansion?

The numbers in row n of Pascal's triangle are exactly the coefficients of (x + y)ⁿ after expansion. Row 3 is 1, 3, 3, 1, so (x + y)³ = x³ + 3x²y + 3xy² + y³. Row 5 is 1, 5, 10, 10, 5, 1, so (x + y)⁵ = x⁵ + 5x⁴y + 10x³y² + 10x²y³ + 5xy⁴ + y⁵. Use the "Binomial Expansion" mode above to get any expansion instantly.

Where does the Fibonacci sequence appear in Pascal's triangle?

The Fibonacci sequence hides along the shallow diagonals. Draw diagonal lines from upper-right to lower-left across the triangle, then sum the numbers on each diagonal. The sums produce: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55… — exactly the Fibonacci sequence. Use the Fibonacci highlight mode in the generator above to see these diagonals colored.

Why are rows with prime numbers special?

If the row number n is prime, every interior entry in that row (all except the two 1s at the edges) is divisible by n. For row 7: the entries are 1, 7, 21, 35, 35, 21, 7, 1. Check: 7, 21, 35 are all divisible by 7. This property is used in number theory — specifically in proving properties of prime numbers and modular arithmetic. Use the "Primes" pattern highlight to see this visually.

What is the 10th row of Pascal's triangle?

Row 10 (the 11th row when counting from 1) of Pascal's triangle is: 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1. The sum of this row is 2¹⁰ = 1,024. The largest number in the row is 252, which sits in the middle at position 5 (C(10,5)).