Draw Pascal Triangle
Draw Pascal Triangle online, free and private. Runs in your browser, no upload, instant and offline.
- Runs in your browser
- Nothing uploaded
- Free, no sign-up
Generates Pascal's triangle for 1-100 rows with exact BigInt arithmetic.
Switch to parity mode to reveal the Sierpinski triangle hidden in odd-vs-even
coefficient positions (Lucas's theorem mod 2).
How to Use Draw Pascal Triangle
- Enter the number of rows (1-100). The tool renders rows 0 through R−1, so "7 rows" means rows 0..6 - that is what most textbooks call "Pascal's triangle through row 6".
- Pick a display mode. Numbers shows every binomial coefficient C(n, k). Parity (Sierpinski) colors each cell by C(n,k) mod 2 - odd cells become slate, even cells stay light - and the Sierpinski fractal emerges from row ~16 onward.
- Click Draw Pascal's Triangle or press Ctrl/Cmd + Enter. The tool uses BigInt for every cell, so values are exact at every row including R = 100 (where the central coefficient has 29 digits).
- Read the stats line. It shows the max value in the last row, its digit count, and the row sum (which equals 2 to the n).
- Copy the triangle as comma-separated text (one row per line) or download it as a
.txtfile for use in scripts or assignments.
Frequently Asked Questions
What is Pascal’s triangle?
Pascal’s triangle is the triangular array where every interior entry is the sum of the two entries directly above it. Row n (starting from row 0) holds the binomial coefficients C(n, 0), C(n, 1), …, C(n, n) – the coefficients of (a + b) to the n. It is named after Blaise Pascal (Traité du triangle arithmétique, 1654), but earlier descriptions appear in works by Halayudha (India, 10th century), Omar Khayyam (Persia, 11th century), Yang Hui (China, 13th century, where it is still called Yang Hui’s Triangle), and Petrus Apianus (Germany, 1527).
Is the math exact at row 100?
Yes. The tool uses JavaScript’s BigInt for every cell from row 0 onward, so all coefficients are exact integers regardless of size. The largest value at R = 100 is C(99, 49) which has 29 digits – JavaScript Number would have lost precision past row 53 (Number.MAX_SAFE_INTEGER is 2 to the 53 minus 1). An earlier version of this FAQ claimed “Number type up to row 30, BigInt for larger” – that was wrong; the code has always used BigInt throughout. Now corrected.
How does the Sierpinski parity view work?
Colour each cell by C(n, k) mod 2 – odd cells filled, even cells empty. By Lucas’s theorem (1878), C(n, k) is odd if and only if every binary digit of k is at most the corresponding binary digit of n; otherwise it is even. The resulting pattern is a discrete approximation of the Sierpinski triangle, with the fractal becoming visually convincing from about row 16 (2^4) and getting sharper at rows 32, 64, 128 (powers of 2). It is the same fractal you get from the Sierpinski triangle’s classical IFS construction.
What is the row-sum identity?
The sum of row n is exactly 2 to the n. This follows from setting a = b = 1 in the binomial theorem: (1 + 1) to the n equals the sum of C(n, k) for k from 0 to n equals 2 to the n. Combinatorially it counts all subsets of an n-element set (each element is either in the subset or out). The stats line at the top of the output shows this for the last row drawn.
Where do the Fibonacci numbers hide?
Sum along the “shallow diagonals” – paths that go one cell right and one cell up-left at each step. The diagonals’ sums are 1, 1, 2, 3, 5, 8, 13, 21, … the Fibonacci numbers. This identity is sum_{k=0}^{floor(n/2)} C(n-k, k) = F(n+1). It is most visible in the Numbers mode for R ≥ 10.
What about “rows are powers of 11”?
Rows 0 through 4 read off as 11^0 through 11^4 directly: 1, 11, 121, 1331, 14641. From row 5 onward the interior values exceed 9, so the digits “carry” into neighbouring positions and the simple concatenation breaks. The pattern is real but trivial – it is just base-10 digit expansion of 11 to the n.
What are the diagonals worth reading?
Diagonal 0 (the outer edge) is all 1s. Diagonal 1 is the natural numbers 1, 2, 3, 4, … Diagonal 2 is the triangular numbers 1, 3, 6, 10, 15, … Diagonal 3 is the tetrahedral numbers 1, 4, 10, 20, 35, … Diagonal k holds the n-th figurate number for the k-simplex: C(n, k) for n = k, k+1, k+2, …
Is anything sent to a server?
No. The page loads three static files (HTML, CSS, JS) and then computes everything in your browser using BigInt arithmetic. You can disconnect from the internet after the page loads and the tool keeps working. No analytics, no telemetry, no cookies.
Is this tool free?
Yes – free, unlimited, no signup, no watermark. Use the output in lectures, assignments, papers, or blog posts freely. Attribution to is appreciated but not required.
Related Tools
Draw Triangle Dragon Fractal →
Draw the terdragon (Davis-Knuth 1970) - space-filling triangle dragon, 3-fold symmetry, dim 2.0. Free,…
Draw Analog Clock →
Draw a real-time or custom analog clock in your browser. Sweeping second hand, Roman/Arabic…
Draw ASCII Table →
Generate ASCII tables in pipe, Markdown, box-drawing, or CSV format. DEC/HEX/OCT/BIN columns, control names,…
Draw Canopy Fractal →
Draw a canopy-tree L-system fractal in your browser. 7 iterations, custom colors, gradient depth,…
Draw Cantor Dust Fractal →
Draw true Cantor Dust (4-corner) or Sierpiński carpet (8-square) in your browser. Color modes,…
Draw Cantor Fractal →
Draw the Cantor set with middle-third deletion. 0-10 iterations, custom colors, dimension and measure…
Draw Digital Clock →
Live HH:MM:SS digital clock with 24-hour toggle, milliseconds, 3 themes, screenshot export. Free, offline,…
Draw Flowsnake Fractal →
Draw the Gosper curve hexagonal space-filling fractal in your browser. Iterations 1-6, custom colors,…
Draw Frosty Fractal →
Draw Frosty Fractal online, free and private. Runs in your browser, no upload, instant…
Draw Hausdorff Fractal →
Draw the Hilbert curve or Moore curve (closed-loop variant) - true space-filling fractals (dim…
Draw Heighway Fractal →
Draw the Heighway dragon (paper-folding fractal) with fire gradient and symmetry modes. L-system based.…
Draw Hexaflake Fractal →
Draw the hexaflake (hexagon snowflake) - 7-hexagon recursive fractal with 6-fold symmetry. Custom colors,…