Skip to content
100% local

Pascal's triangle

Generate Pascal's triangle to any number of rows, with optional exact big-number math.

Output

Pascal's triangle

Pascal's triangle is the number pyramid where every entry is the sum of the two entries above it, with a 1 at the start and end of every row. This generator builds it instantly to any depth: set how many rows you want and the triangle appears right away, no calculator needed.

"Rows" controls how deep the triangle goes, up to 200. "Output format" switches between the classic centered pyramid, plain space-separated rows, a batch mode that lists every value one per line for pasting into another tool, and a probabilities view showing each entry as its share of the row's total — useful for coin-flip and binomial-distribution problems, sized by "Decimal places". Turn on "Support very large numbers" to switch to exact BigInt math: past around row 53, ordinary numbers start losing precision, while BigInt keeps every digit correct however deep the triangle goes. "Show calculation steps" appends the addition behind the last row's values, written as C(row, index) so it reads the same in every language.

The row values are binomial coefficients, used for probability, for expanding expressions like (a + b)ⁿ, and for counting combinations. Students use the triangle to check binomial-expansion homework by hand, teachers print rows for handouts, and programmers use it to sanity-check a combinatorics function against known values. Output is capped at a safe size, with a clear message rather than a frozen tab if a request is too large to render.

Everything runs locally in your browser — no row count or option is ever sent anywhere. The result updates live as you change the settings, so you can copy it, download it as a .txt file, or send it straight to another tool.

FAQ

How is each number in Pascal's triangle calculated?
Every entry is the sum of the two entries diagonally above it in the previous row, with a 1 placed at the start and end of every row. Row 0 is just "1"; row 4 is 1, 4, 6, 4, 1.
When should I turn on "Support very large numbers"?
Turn it on whenever you generate more than about 50 rows. Past that point the values exceed what a standard JavaScript number can store exactly, and this option switches to BigInt math so every digit stays correct.
What does the "Probabilities" format show?
Each entry divided by the row's total (2 raised to the row number), which is the probability of getting that many heads in that many coin flips — the same numbers behind the binomial distribution.
What's the difference between the triangle and rows formats?
Triangle centers each row to form the familiar pyramid shape. Rows lists the same numbers left-aligned, one row per line, which is easier to paste into a spreadsheet or another tool.
Is my data uploaded anywhere?
No. The triangle is generated entirely in your browser — no row count, option or result ever leaves your device.