Skip to content
SoftwareSolutions.net
Calculators & Converters

Pascal triangle generator

Generate rows of Pascal's triangle.

Try it

Ready

Settings

Output

The result appears here.

About Pascal triangle generator

A Pascal triangle generator builds rows of Pascal's triangle, a number pattern in which each entry is the sum of the two entries above it. Enter how many rows you want and the tool prints the triangle, starting with a single 1 at the top. It is used to teach patterns in arithmetic, to find binomial coefficients and to explore counting problems.

The triangle is named after Blaise Pascal, who studied its properties in the 1650s, though the pattern was known in China, India and Persia much earlier. The same numbers give the coefficients of the expansion of (a + b) raised to a whole-number power, which is why they turn up in algebra and probability.

How to use Pascal triangle generator

  1. Enter the number of rows you want, from 1 to 20.
  2. Generate the triangle.
  3. Read each row. The first and last number in every row is always 1.
  4. Copy the text into a document or spreadsheet if you need it for a lesson or project.

How each row is built

Each new row starts and ends with 1. Every number in between is the sum of the two numbers directly above it. Row 4 is 1, 3, 3, 1, because 1 + 2 = 3 and 2 + 1 = 3 come from the row above.

Row n, counting from zero, gives the coefficients of (a + b) to the power n. Row 3 gives 1, 3, 3, 1, which matches the expansion of (a + b) cubed.

Patterns to look for

The sum of each row doubles from the row before, so row n adds up to 2 to the power n. The diagonal of counting numbers, 1, 2, 3, 4 and so on, appears in the second position of each row. Shallow diagonals contain triangular numbers.

Colouring the odd numbers in the triangle produces a fractal known as Sierpinski's triangle. That is a good way to show students how a simple rule can create complex structure.

Using the triangle in teaching

Students can colour the odd and even entries to reveal patterns. Shading the odd numbers produces a fractal, which connects a simple counting rule with a surprisingly complex picture. The activity works well for ages ten and up.

The diagonal sums reveal the Fibonacci sequence. Adding the numbers along a shallow diagonal gives 1, 1, 2, 3, 5 and so on, which makes a good link between counting and recursive patterns.

Ask students to predict the next row before you generate it. Predicting first and then checking builds the habit of looking for a rule, and the discovery that each row is the sum of the two above it is one of the most memorable results in early algebra.

Frequently asked questions

How many rows can I generate?

This tool goes up to 20 rows, which is enough for most teaching and for checking binomial coefficients by hand.

Why does the triangle use only whole numbers?

Each entry is a sum of whole numbers, so every value stays an integer.

Can I use it to expand a binomial?

Yes. Read the row that matches the power, and use those numbers as the coefficients of the expansion.

Related tools

Tools that pair well with this one.