Pascal's Triangle Generator
Choose how many rows of Pascal's triangle to generate.
Result
How it is calculated
You choose the number of rows, and the tool builds Pascal's triangle one row at a time with whole-number addition. Row 0 is just 1. Every later row starts and ends with 1, and each middle entry is the sum of the two entries above it: T(r, k) = T(r−1, k−1) + T(r−1, k). The entries of row n are the binomial coefficients C(n, k), which count the ways to choose k items from n. The tool prints the rows, then the total number of entries, rows × (rows + 1) ÷ 2, and the largest value in the last row. The row count is rounded to a whole number and must be between 1 and 25; values outside that range give no result. Because only integers are used, there is no rounding error.
Worked example
Ask for 6 rows. Row 1 is 1. Row 2 is 1 1. Row 3 is 1 2 1. Row 4: 1, then 1+2 = 3, 2+1 = 3, then 1, giving 1 3 3 1. Row 5 is 1 4 6 4 1. Row 6 is 1 5 10 10 5 1, where 5 = 1+4, 10 = 4+6 and 10 = 6+4. The total number of entries is 6 × 7 ÷ 2 = 21, so the tool reports 21 elements. The largest value in the last row is 10, which equals C(5, 2), the number of ways to choose 2 items from 5.
Common mistakes
- Treating the first row you see as row 1 in binomial formulas. The tool's first line is row 0 in math terms, C(0, 0), so its sixth line is the row for n = 5.
- Asking for more than 25 rows. The tool stops at 25 and returns nothing above that, to keep the numbers readable.
- Entering a decimal such as 4.6 and expecting an error. It is rounded to 5 rows.
- Reading the total number of elements as the sum of the values. It counts the entries (21 for 6 rows), while the sum of row n is 2n.
- Using the triangle to expand (x + y)n with the wrong row. For the power n, take the line with n + 1 numbers, such as 1 3 3 1 for the cube.
About this calculator
Pascal's triangle is a triangular array of numbers where each entry is the sum of the two directly above it, starting from a single 1 at the top — the values in each row are exactly the binomial coefficients C(n,k), the number of ways to choose k items from a set of n. This generator builds any number of rows using exact integer arithmetic, so the values stay precise even for large row counts where floating-point rounding would otherwise creep in.
The triangle is a core teaching tool in combinatorics and algebra, used to expand binomials like (x+y)^n without multiplying term by term, to read off combination counts directly, and to illustrate patterns in number theory such as powers of 11, triangular numbers, and connections to the Fibonacci sequence found along its diagonals.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Beyond binomials, the rows hide other patterns you can spot-check against the output. The second diagonal counts 1, 2, 3, 4, and the third lists triangular numbers: 1, 3, 6, 10. Row 25 is the largest this tool prints, with a middle value of 2,704,156, so it is useful for checking combination counts such as C(24, 12). Which pattern in the triangle would you like to see highlighted next?