Skip to content

Pascal's Triangle Generator

Choose how many rows you want and get Pascal's triangle with every entry exact — row 99 has 29-digit numbers. Highlight the odd entries to reveal the Sierpiński triangle, shade multiples of any number, or pick out a diagonal or a Fibonacci diagonal. Print it as a clean sheet or copy it as plain text. Free, no sign-up — it all happens in your browser.

1 to 100. Row 0 is the single 1 at the top. Wide triangles scroll sideways on screen; turn off the numbers to see the pattern.

Highlight

Pascal's triangle

  1. 1
  2. 11
  3. 121
  4. 1331
  5. 14641
  6. 15101051
  7. 1615201561
  8. 172135352171
  9. 18285670562881
  10. 193684126126843691
  11. 1104512021025221012045101
  12. 1115516533046246233016555111

Row 11 has 12 entries that add up to 2¹¹ = 2048. Its middle entry is 462.

45 of the 78 entries are odd — the Sierpiński triangle appears in the pattern.

How to Use the Pascal's Triangle Generator

  1. 1. Pick the rows. Enter 1 to 100. Row 0 is the single 1 at the top, so 12 rows end at row 11.
  2. 2. Choose a highlight. Odd numbers shows the Sierpiński pattern, Multiples of m shades every entry divisible by m, A diagonal picks one diagonal (0 is the ones, 2 the triangular numbers), and A shallow diagonal picks the entries that add up to a Fibonacci number.
  3. 3. Switch the view. Turn Show the numbers off for a pure pattern view — the way to see the Sierpiński triangle at 64 or 100 rows — and turn on Show row sums to label each row with its total.
  4. 4. Print or copy. Print prints just the triangle, in the colours you see; Copy triangle puts the rows on the clipboard as plain text.

How the Triangle Is Built

Every row starts and ends with 1, and every other entry is the sum of the two entries above it: C(n, k) = C(n − 1, k − 1) + C(n − 1, k). The entry in row n at position k, counting from 0, is the binomial coefficient C(n, k) = n! ÷ (k!(n − k)!) — the number of ways to choose k things from n. In row 6, 1, 6, 15, 20, 15, 6, 1, the entry 15 is C(6, 2) = 6 × 5 ÷ 2.

Blaise Pascal wrote the triangle up in his Traité du triangle arithmétique (1654, printed 1665) and used it to solve problems in probability, but it was known centuries earlier in India, Persia and China — in China it is still called Yang Hui's triangle.

Patterns to Look For

PatternWhere to see itExample
Row sums are powers of 2Add any rowRow 6 adds to 64 = 2⁶
DiagonalsHighlight diagonal 1, 2 or 3Counting numbers 1, 2, 3, …; triangular numbers 1, 3, 6, 10, …; tetrahedral numbers 1, 4, 10, 20, …
Fibonacci numbersHighlight a shallow diagonalr + c = 9 adds to 1 + 8 + 21 + 20 + 5 = 55 = F(10)
Sierpiński triangleHighlight odd numbersRow n has 2^k odd entries, where k is the number of 1s in n's binary form
Powers of 11Read a row as digitsRow 4 reads 14641 = 11⁴; from row 5 the entries carry
Hockey stickAdd down a diagonal1 + 3 + 6 + 10 = 20, the entry just below and to the side

Why It Matters: the Binomial Theorem

Row n of the triangle gives the coefficients of (a + b)ⁿ. Row 4 is 1, 4, 6, 4, 1, so (a + b)⁴ = a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴. The same numbers count outcomes: the chance of exactly 2 heads in 4 fair coin tosses is C(4, 2) ÷ 2⁴ = 6 ÷ 16, because row 4 adds to 16.

The Sierpiński pattern is not a coincidence. By Lucas's theorem, C(n, k) is odd exactly when every 1 in the binary form of k is also a 1 in n, which is why row 7 (binary 111) is all odd and row 8 (binary 1000) has just two odd entries. Shading multiples of 3, 5 or any other prime gives a similar fractal in different proportions.

Frequently Asked Questions

What is Pascal's triangle?
A triangle of numbers in which each entry is the sum of the two above it, with 1s down both edges. Its entries are the binomial coefficients C(n, k), so it tells you how many ways there are to choose k items from n and gives the coefficients when you expand (a + b)ⁿ.
How do I find a single entry without building the whole triangle?
Use the formula C(n, k) = n! ÷ (k!(n − k)!), counting rows and positions from 0. The middle entry of row 10 is C(10, 5) = 252. The Permutation & Combination Calculator computes any C(n, k) directly.
What do the row sums of Pascal's triangle equal?
Row n adds up to 2ⁿ. Row 0 is 1, row 1 is 2, row 2 is 4, row 3 is 8. The reason is that choosing any subset of n things is counted once by exactly one entry of the row.
Where are the Fibonacci numbers in Pascal's triangle?
Along the shallow diagonals — the lines of entries C(n − k, k) that go up and to the right. The entries on the line where row plus position equals s add up to the Fibonacci number F(s + 1). Choose A shallow diagonal and try s = 9 to get 55.
Why do the odd numbers form a Sierpiński triangle?
Because C(n, k) is odd exactly when the binary digits of k fit inside those of n. That rule is self-similar: the first 2ⁿ rows repeat in the next block of rows as a copy of the triangle with a hole in the middle — the Sierpiński pattern, built from the same rule at every scale.
How many rows can I generate, and are the numbers exact?
Up to 100 rows, with every entry exact. From row 57 onward the middle entries exceed 2⁵³, so a spreadsheet or ordinary calculator would round them, so this tool uses whole-number arithmetic throughout. The largest entry shown, C(99, 49), is 50445672272782096667406248628.
How do I print Pascal's triangle?
Set the rows and highlight, then press Print. Only the triangle is printed, with highlights in colour if your printer supports it. For many rows, switch off the numbers for a compact pattern, or print landscape so the wide bottom rows fit.

More in Math Calculators

See all Math Calculators