Pascal’s Triangle Row Calculator
Enter a row index n (starting at 0) and the tool prints row n of Pascal's triangle in full: the binomial coefficients C(n, 0), C(n, 1), …, C(n, n), the row sum (always 2ⁿ), the maximum value and the matching (a + b)ⁿ expansion. Note that the same triangle was published by Yang Hui ("Yang Hui's triangle", 楊輝三角) in his 1261 commentary on the Nine Chapters — about 400 years before Pascal's 1665 Traité — and was known still earlier to the Persian mathematician al-Karaji (c. 1000) and Indian Pingala (~200 BCE). Useful for combinatorics, binomial-distribution problems, algebraic expansion and generating functions. Internally uses BigInt to avoid floating-point precision loss; supports n = 0 to 60, runs entirely client-side.
Enter an integer n with 0 ≤ n ≤ 60.
Binomial coefficients
1 6 15 20 15 6 1
Row sum (2ⁿ)
64
Maximum value
20
at position 3
(a + b)ⁿ expansion
—
Formula
C(n, k) = n! ⁄ [k! · (n − k)!] = C(n − 1, k − 1) + C(n − 1, k); (a + b)ⁿ = Σₖ C(n, k) · aⁿ⁻ᵏ · bᵏ; Σₖ C(n, k) = 2ⁿ.
- · Indices start at 0: row 0 = [1], row 1 = [1, 1], row 2 = [1, 2, 1], row 3 = [1, 3, 3, 1], etc. Row n has n + 1 entries.
- · Pascal recurrence: every interior entry is the sum of the two entries diagonally above it: C(n, k) = C(n − 1, k − 1) + C(n − 1, k), with boundaries C(n, 0) = C(n, n) = 1.
- · Symmetry: C(n, k) = C(n, n − k). Each row reads the same forwards and backwards (palindromic).
- · Row sum: always 2ⁿ (the expansion of (1 + 1)ⁿ). Row 10 sums to 1024 = 2¹⁰. Equivalently: the number of subsets of an n-element set is 2ⁿ.
- · Maximum sits at the centre: for even n the unique maximum is at k = n / 2; for odd n there is a tie between k = (n − 1) / 2 and k = (n + 1) / 2.
- · Other patterns: the "shallow diagonal" sums give the Fibonacci sequence (row-n shallow-diagonal sum = F(n + 1)); the lateral diagonals are the figurate numbers (triangular, tetrahedral, …).
- · Range supported: n = 0 to 60. At n = 60 the central coefficient C(60, 30) ≈ 1.18 × 10¹⁷ exceeds Number.MAX_SAFE_INTEGER (2⁵³ ≈ 9.0 × 10¹⁵), so the tool computes with BigInt internally for exactness and only converts to Number for display.
- · References: Pascal, "Traité du triangle arithmétique" (1665); Yang Hui, 詳解九章算法 (1261); OEIS sequence A007318; Knuth, TAOCP Vol 1 §1.2.6 (Mathematical Preliminaries).
Frequently asked
What is Pascal's triangle actually used for?
Main uses: (1) Binomial expansions — the coefficients of (a + b)⁵ are row 5 = 1, 5, 10, 10, 5, 1. (2) Combinatorics — C(n, k) counts the ways to choose k items from n; row 6 entry 3 is C(6, 3) = 20, the number of ways to pick a team of 3 from 6 students. (3) Binomial-distribution probability — the probability of exactly k heads in n fair coin flips is C(n, k)/2ⁿ. (4) The Fibonacci numbers appear as sums along the shallow diagonals. (5) Colouring odds black and evens white produces the Sierpiński triangle (a textbook fractal). (6) Yang Hui originally used it (1261) to compute higher-order roots as a numerical approximation method.
Does the row count start at 0 or 1?
Modern convention: indexing starts at 0. Row 0 = [1] (i.e. (a + b)⁰ = 1), row 1 = [1, 1], row 2 = [1, 2, 1], etc. The advantage is that "row n" matches (a + b)ⁿ, C(n, k) plugs in directly, and the row sum is exactly 2ⁿ rather than 2ⁿ⁻¹. Older works (especially pre-19th-century) sometimes labelled row 1 as [1], but that convention has fallen out of use. The tool follows the modern 0-based convention.
Why is it called "Pascal's" triangle if Yang Hui found it 400 years earlier?
A textbook case of Stigler's law of eponymy (named objects are rarely named after their first discoverer). The history goes deep: Pingala in India (~200 BCE) studied syllable combinations; al-Karaji in Persia (~1000 CE) gave a systematic derivation; Yang Hui in China (1261); al-Tusi in central Asia (13th c.); Stifel in Germany (1544), Tartaglia in Italy (1556), and finally Pascal's 1665 Traité du triangle arithmétique — the first thorough Western treatment of its applications. Because mathematical history was written from a Eurocentric perspective, the name "Pascal" stuck. Chinese scholarship still calls it 楊輝三角 (Yang Hui's triangle), Indian texts call it Meru-prastara, Iranian sources call it al-Tusi's triangle. Same object, different cultural memory.
Why does the tool cap n at 60?
Two reasons. (1) Display usability — at n = 60 the row already has 61 entries with a peak of ~1.18 × 10¹⁷; pushing further makes the row unreadable and breaks the expansion layout. (2) Floating-point precision — JavaScript Number is exact only up to ±2⁵³ ≈ ±9 × 10¹⁵, and for n ≥ 56 the central coefficient blows past that safe integer range. The tool computes with BigInt internally to keep the digits exact, then converts to Number for display; the conversion silently loses digits above n = 60. For larger n use a Python REPL (arbitrary precision) or hook into the math module directly: `import { pascalRow } from "src/lib/math/pascal-row"` and consume the BigInt computation.
Related tools
Percentage Calculator
Percent of, percent change, and percent add/subtract in one.
GCD & LCM Calculator
Enter 2–6 positive integers to get the greatest common divisor (HCF / GCD) and least common multiple (LCM), with the Euclidean step chain shown.
Average Calculator (Mean / Median / Mode)
Enter a list of numbers to get the mean, median, mode, range plus standard deviation, variance and total.
Quadratic Equation Solver
Enter the coefficients of ax² + bx + c = 0 to find the real or complex roots, discriminant and vertex.
Password Strength (Entropy) Calculator
Estimate a password's bit entropy, brute-force time and strength tier. All computation happens in your browser.
Scientific Notation Converter
Convert between standard decimal numbers and scientific notation, with significant figures and order of magnitude.
Permutations & Combinations (nPr / nCr) Calculator
Compute permutations P(n,r), combinations C(n,r) and factorial n! — useful for probability problems, lottery odds and combinatorics homework.
Standard Deviation Calculator
Paste a list of numbers to compute mean, median, sample and population variance and standard deviation — with the working shown.
Triangle Calculator (SSS / SAS / ASA)
Solve a triangle from 3 sides, 2 sides + 1 angle, or 2 angles + 1 side — area, perimeter and remaining parts via the law of sines / cosines.
Pythagorean Theorem Calculator
Given any two sides of a right triangle (two legs, or one leg plus the hypotenuse), instantly find the third side, area, perimeter and the two non-right angles.
Circle Calculator (radius / diameter / circumference / area)
Enter any one of radius, diameter, circumference or area to get the other three — useful for design, engineering and DIY.
Roman Numeral Converter
Two-way conversion between Arabic numbers (1–3999) and Roman numerals (I, V, X, L, C, D, M) — handy for typesetting, chapter titles and homework.
Slope & Line Equation Calculator (y = mx + b from Two Points)
Enter two points (x₁, y₁) and (x₂, y₂) to instantly get the slope, y-intercept, line equation y = mx + b, distance, and midpoint — a classroom staple for algebra and coordinate geometry.
Birthday Paradox Calculator
Enter group size n to see the probability that at least two people share a birthday — the classic birthday problem.
Logarithm Calculator (log / ln / log₂ / any base)
Compute logₐ(x) for any base — natural log (ln), common log (log₁₀), binary log (log₂) and a custom base, with the change-of-base steps shown.
Z-Score (Standard Score) Calculator
Enter a value, the mean and the standard deviation to compute the z-score and the corresponding normal-distribution percentile and probabilities.
Screen Pixel Density (PPI) Calculator
Enter the screen resolution and diagonal size to get pixel density (PPI), real width/height, dot pitch and total pixel count.
Hong Kong Mark Six Odds Calculator
Enter the number of tickets / selections and see the actual probability of hitting first, second … prizes in a Mark Six (6-of-49) draw.
Decimal to Fraction Converter
Convert any decimal (including repeating decimals) to a simplified fraction and a mixed number.
Sphere Volume & Surface Area Calculator
Give a sphere any one of radius, diameter, surface area or volume and instantly get the other three — plus the great-circle circumference and area.
Cylinder Volume & Surface Area Calculator
Enter the radius and height of a cylinder to get volume (π r²h), lateral surface, base area and total surface area.
Permutations (nPr) Calculator
Compute nPr — the number of ordered arrangements of r items chosen from n — alongside n!, r! and the related combination nCr.
Prime Factorization Calculator
Factor any integer from 2 up to 10¹² into primes, see the canonical exponent form, count and list all divisors.
Geometric Mean Calculator
Compute the n-th root of the product of n positive numbers — the right average for growth rates, returns and ratios — alongside the arithmetic mean for comparison.
Fibonacci Sequence Calculator
Enter any integer n from 0 to 1500 to instantly compute F(n) and F(n−1) with BigInt precision, the consecutive-term ratio (converging to the golden ratio φ) and the first 30 terms of the sequence.
Dice Roll Probability Calculator
Pick the number of dice, sides (d4 / d6 / d8 / d10 / d12 / d20) and a target sum to compute the probability of rolling exactly that total, at least, or at most.
Arithmetic Series Calculator
Enter first term a, common difference d and number of terms n to compute the nth term aₙ and the partial sum Sₙ = n/2·(2a + (n − 1)d).
Survey Sample Size Calculator
Enter confidence level, margin of error, expected proportion (and optional population size) to compute the survey sample size you need.
Geometric Series Sum Calculator
Enter the first term a, common ratio r and number of terms n to find the sum of the first n terms of a geometric series — plus the infinite-series sum when |r| < 1.
Cone Volume & Surface Area Calculator
Enter base radius and height to get the cone volume, slant height, lateral, base and total surface area.
Music Note Frequency Calculator
Pick a note (C, C♯, D, …), octave and tuning reference A4 (440 Hz by default) and the tool returns the frequency in Hz, the wavelength in air and the MIDI note number via f = A4 × 2^((n − 69)/12).
Linear Interpolation Calculator (Lerp)
Enter two known points (x₁, y₁) and (x₂, y₂) and a target x to instantly read off y via y = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁) — the tool flags whether your x sits inside the two points (interpolation) or outside (extrapolation).
Trapezoid Area Calculator
Enter the two parallel sides and height of a trapezoid to get its area, midsegment length and perimeter when the legs are known.
Binomial Probability Calculator
Enter the number of trials n, the per-trial success probability p and a target number of successes k to get P(X = k), P(X ≤ k), P(X ≥ k) along with the distribution mean and standard deviation.
Pearson Correlation Coefficient Calculator
Paste two parallel data series (X and Y) and get the Pearson correlation coefficient r, r², the best-fit line slope and intercept, and the sample means and standard deviations.
Confidence Interval for the Mean Calculator
Enter the sample mean, sample standard deviation, sample size and confidence level to compute a confidence interval for the population mean using the t (or z) distribution, with margin of error and standard error.
Cohen's d Effect Size Calculator
Enter the means, standard deviations and sample sizes of two groups to compute Cohen's d and Hedges' g effect sizes, classified per Cohen 1988 as trivial / small / medium / large.
Modulo (Remainder) Calculator
Enter dividend a and divisor n to compute the quotient and remainder a mod n. The truncated (C / JavaScript %), floored (Python / mathematical) and Euclidean conventions are shown side by side so the negative-input differences are obvious.
chmod Permission Converter (Octal ↔ rwx)
Toggle read/write/execute for user, group and other to instantly get both octal (e.g. 755) and symbolic (e.g. rwxr-xr-x) notations.
Vector Magnitude & Direction Calculator (2D / 3D)
Enter 2D or 3D vector components (x, y, z) to compute the magnitude, unit vector and direction angles.
Percent Error Calculator (Percent Error & Percent Difference)
Enter experimental and theoretical (accepted) values to get absolute percent error, signed relative error, and absolute error. Switch to percent-difference mode to compare two measurements where neither is the accepted value.
Poisson Distribution Probability Calculator
Enter the mean event rate λ and an event count k to get P(X = k), P(X ≤ k), P(X ≥ k), the mean, variance and standard deviation — useful for queueing, call-centre staffing and rare-event modelling.
Bayes’ Theorem Probability Calculator
Enter the prior P(A), the sensitivity P(B|A) and the false-positive rate P(B|¬A); the tool applies Bayes’ theorem to give the posterior P(A|B) — handy for medical tests, spam filters and any classification decision.
Arc Length & Sector Area Calculator
Enter a circle’s radius and central angle (degrees or radians) to compute the arc length s = r·θ, sector area A = ½·r²·θ and chord length — useful for geometry, machining and architectural layout.
Matrix Determinant Calculator (2×2 and 3×3)
Enter the entries of a 2×2 or 3×3 matrix and instantly get the determinant det(A) via ad − bc or cofactor expansion along the first row, with an invertibility check and the step-by-step 2×2 minors shown for linear-algebra study.
Vector Dot Product Calculator (2D / 3D)
Enter two 2D or 3D vectors and instantly compute the dot product, included angle, scalar projection and vector projection — with hints for orthogonal, parallel and anti-parallel cases.
Cosine Similarity Calculator
Enter two numeric vectors of any dimension and compute cos θ = (a·b) / (|a|·|b|), plus the angular distance — the staple similarity metric in NLP, recommender systems and document-similarity scoring.
Percent Difference Calculator (Symmetric)
Enter two values and compute the symmetric percent difference |a − b| / ((|a| + |b|) / 2) alongside the directional percent change (b − a)/a — a common source of confusion in lab reports and news headlines.
Vector Cross Product Calculator (3D)
Enter two 3D vectors a and b, compute the cross product a × b together with its magnitude (the area of the parallelogram they span) and sin θ — the workhorse of physics torque, computational geometry and 3D graphics.
Distance Between Two Points Calculator (2D / 3D)
Enter two points in the plane or in 3D space and the tool returns the straight-line Euclidean distance √Σ(Δᵢ)², each axis delta and the midpoint — handy for geometry homework, CAD measurements and planar GIS work.
Coefficient of Variation Calculator (CV)
Enter a dataset and the tool returns the coefficient of variation CV = σ / μ × 100% (standard deviation divided by mean) — the standard yardstick for comparing dispersion across datasets with different units or magnitudes (lab repeatability, portfolio risk).
Median, Quartiles & IQR Calculator
Enter a dataset and the tool sorts it and returns the median, first and third quartiles, the inter-quartile range (IQR) and Tukey 1.5×IQR outlier fences — the five-number summary behind every box plot.
Harmonic Mean Calculator
Enter a set of positive numbers and compute the harmonic mean HM = n / Σ(1/xᵢ) alongside the arithmetic and geometric means — the right average when the data behaves like rates or denominators (speeds, P/E ratios, flow rates).
Shannon Entropy Calculator
Enter a list of class probabilities or frequencies and compute Shannon entropy H = −Σ pᵢ log₂ pᵢ (bits) alongside the maximum entropy and the normalised entropy — the foundation of information theory, decision-tree splits and password analysis.
Regular Polygon Calculator (Area, Angles, Radii)
Enter the side count n and side length s of a regular polygon and the tool returns the interior and exterior angles, the apothem and circumradius, the area and the perimeter in one shot — works for triangles, squares, pentagons, hexagons and beyond.
Catalan Number Calculator (Cₙ)
Enter n and the tool returns the n-th Catalan number Cₙ = (2n)! / ((n+1)! · n!) — the textbook count for balanced parentheses, binary tree shapes, Dyck paths and many other combinatorics problems.
RMSE / MAE Forecast Error Calculator
Enter a column of actual values and a column of predicted values; the tool computes MAE, MSE, RMSE, R² and MAPE side-by-side — the staple set of regression-error metrics in machine learning, forecasting and lab-vs-model comparisons — and explains how each one weights outliers differently.
Linear System Solver — 2 Equations, 2 Unknowns
Enter the 6 coefficients of ax + by = e and cx + dy = f. The tool applies Cramer's rule to return x, y, the determinant D and the system's classification (unique solution / no solution / infinitely many), showing the working out so it doubles as a homework check.
At-Least-One Probability Calculator
Enter a per-trial probability p and a trial count n; the tool returns the probability of at least one success 1 − (1 − p)ⁿ, the expected count np, and the trials needed to reach a target probability — the maths behind raffles, gacha pulls, A/B tests and redundancy design.
Chi-Square Goodness-of-Fit Test Calculator
Enter observed and expected counts; the tool computes the chi-square statistic χ² = Σ (O − E)² / E, degrees of freedom and the p-value to test whether the observed distribution deviates significantly from theory — the standard test for die fairness, Mendelian ratios and categorical A/B counts.
Expected Value Calculator (E[X] = Σ p·x)
Enter outcome values x and matching probabilities p; the tool returns the expected value E[X] = Σ p·x, variance Var(X) and standard deviation σ — the foundational metric for casino games, insurance pricing, investment decisions and A/B-test analysis.
Margin of Error Calculator (Polls & Sampling)
Enter sample size n, sample proportion p (or sample standard deviation) and a confidence level (90 / 95 / 99 %); the tool computes the margin of error MOE = z·√(p(1−p)/n) and the matching confidence interval — the core statistic behind political polls, A/B tests and market research.
Mean Absolute Deviation Calculator (MAD)
Enter a list of numbers; the tool returns the mean absolute deviation (MAD = average of |xᵢ − mean|) — a more intuitive spread measure than standard deviation, used in school statistics and demand-forecasting accuracy.
R² Coefficient of Determination Calculator
Paste (x, y) data points; the tool fits an ordinary least-squares regression and reports the coefficient of determination R², slope, intercept and Pearson r — the standard "how much variance is explained" measure.
Pyramid Volume Calculator
Enter base dimensions and height; the tool returns volume, base area, slant height, lateral surface area and total surface area for square, rectangular, equilateral-triangular or regular n-gon based right pyramids using V = ⅓ × base area × height.
Parallelogram Area Calculator
Enter base and height, or two side lengths and the included angle; the tool returns the parallelogram area, perimeter and both diagonals via A = b · h or A = a · b · sin θ.
Ellipse Area & Circumference Calculator (Ramanujan)
Enter the semi-major axis a and semi-minor axis b; the tool returns the area A = π a b and uses Ramanujan's second approximation for the perimeter — relative error below 4 × 10⁻⁵ across all eccentricities.
P-value from Z-score Calculator
Enter a Z-score; the tool returns the one-sided (left / right) and two-sided p-values, and flags significance against α = 0.05 / 0.01 / 0.001 — the missing step of nearly every hypothesis test.
Spherical Cap Volume & Surface Area Calculator
Enter the sphere radius R and cap height h; the tool returns V = πh²(3R − h)/3 and the curved surface area A = 2πRh — useful for partial spherical tanks, domes and lens segments.
Mode of a Dataset Calculator
Paste a list of values; the tool scans the dataset and reports the most-frequent value(s), handling unimodal, bimodal and multimodal cases, with the full frequency table — the standard intro-statistics tool for categorical and discrete data summaries.
Exponential Growth / Decay Calculator (N = N₀·e^(kt))
Enter initial value N₀, continuous rate constant k and elapsed time t; the tool returns N(t) = N₀·e^(kt), the per-period change, and the doubling time (k > 0) or half-life (k < 0) — the universal model for populations, bacteria, radioactive decay, first-order pharmacokinetics and continuously compounded interest.
Collatz Sequence Calculator (3n + 1 Conjecture)
Enter any positive integer n; the tool iterates the Collatz rule (even → n/2, odd → 3n+1) until it reaches 1 and lists the full sequence, the number of steps and the peak value reached — a classic number-theory and programming exercise.
Triangular Number Calculator (Tₙ = n(n+1)/2)
Enter a positive integer n and the tool returns the n-th triangular number Tₙ = n(n+1)/2, or inversely: given any positive integer N, identify whether N is triangular (and at which index) — staple of combinatorics, the handshake problem and math competitions.
Sum of Squares Calculator (Σi²)
Enter a positive integer n; the tool applies Σᵢ₌₁ⁿ i² = n(n+1)(2n+1)/6 to return the sum of the first n squared positive integers, along with the sum of cubes ([n(n+1)/2]²) and the arithmetic sum — fundamental identities for induction, series and statistics problems.
Golden Ratio Calculator (φ)
Enter any length and the tool splits it into long / short parts so that a/b = (a+b)/a using the golden ratio φ ≈ 1.6180339887, or inversely: input two segments and see how closely their ratio approaches φ — a staple of design, photography, layout and mathematics.
Law of Cosines Calculator
Enter two sides and the included angle (SAS) or three sides (SSS); the tool applies c² = a² + b² − 2ab·cos C to solve the unknown side or angle and reports all three sides and angles — a core surveying, construction and navigation tool.
Board Feet Lumber Calculator
Enter board thickness (in), width (in) and length (ft); the tool applies BF = (T × W × L) ⁄ 12 to return board feet per piece, total board feet, volume (ft³ / m³) and total cost — used by woodworkers, furniture makers and DIY hobbyists for lumber budgeting.
Triangle Incircle / Circumcircle Calculator
Enter the three sides a, b, c of a triangle; the tool applies r = A ⁄ s (inradius) and R = abc ⁄ (4A) (circumradius) to return both circle radii, plus triangle area via Heron's formula — a workhorse for geometry homework, mechanical layout and architectural design.
Modular Exponentiation Calculator (a^b mod n)
Enter base a, exponent b and modulus n; the tool uses the square-and-multiply fast-exponentiation algorithm with BigInt support to compute a^b mod n — the core operation behind RSA cryptography, hashing and modular-arithmetic homework.
Modular Inverse Calculator (a⁻¹ mod n)
Enter a and modulus n; the tool uses the extended Euclidean algorithm to return the modular inverse (a·x ≡ 1 mod n), gcd(a, n) and the Bézout identity — required for RSA private-key generation, the Chinese Remainder Theorem and solving linear congruences.
CIDR Subnet Calculator (IPv4)
Enter an IPv4 address and CIDR prefix length (e.g. 192.168.1.10/24); the tool returns the subnet mask, network address, broadcast address, usable host range and total host count — a daily tool for network admins and SREs.
Simplify Fraction Calculator
Enter a numerator and denominator (e.g. 48 ⁄ 60); the tool reduces to lowest terms via the greatest common divisor (4 ⁄ 5) and also shows the mixed-number, decimal and percent equivalents — a workhorse for primary and middle-school maths homework.