Pythagorean Theorem Calculator
Pick whether you want the hypotenuse or the missing leg, enter two positive numbers, and get the third side, the triangle area (½ a b), perimeter (a + b + c) and the two non-right angles (computed via atan2). The classic 3-4-5, 5-12-13 and 8-15-17 are all integer Pythagorean triples that round-trip exactly.
Enter two positive side lengths. If the hypotenuse is given, it must be longer than the known leg.
Side a
3
Given
Side b
4
Given
Hypotenuse c
5
Computed
Area
6
Perimeter
12
Angle opposite a (∠A)
36.87°
Angle opposite b (∠B)
53.13°
Formula
c = √(a² + b²) ; b = √(c² − a²) ; area = ½ a b ; ∠A = atan(a / b)
Side units can be anything (cm, m, in, ft) — the result stays in the same unit since this is pure geometric scaling.
Formula
a² + b² = c² c = √(a² + b²) b = √(c² − a²) Area = ½ a b ; Perimeter = a + b + c ∠A = atan(a / b) ; ∠B = 90° − ∠A
- · Applies only to right triangles (one angle equals 90°). For arbitrary triangles use a SSS / SAS / ASA solver.
- · Side lengths can be in any unit (cm, m, inch, ft, mile) — the answer comes back in the same unit because this is pure geometric scaling.
- · Area uses ½ × the two legs; the hypotenuse never enters the area formula.
- · When you know a leg and the hypotenuse, the hypotenuse must strictly exceed the leg — otherwise the triangle is impossible.
- · Common integer Pythagorean triples: 3-4-5, 5-12-13, 8-15-17, 7-24-25, 9-40-41, 20-21-29 — useful sanity checks.
- · References: Euclid, "Elements", Book I Proposition 47; NIST SP 811 (unit definitions).
Frequently asked
When do I pick "solve for hypotenuse" vs "solve for leg"?
If you know the two legs (the sides next to the right angle), solve for the hypotenuse: c = √(a² + b²). If you know one leg and the hypotenuse (the longest side, opposite the right angle), solve for the missing leg: b = √(c² − a²). The hypotenuse is always the longest side.
Why does it complain when I enter leg = 5 and hypotenuse = 3?
The Pythagorean theorem requires c² ≥ a², i.e. the hypotenuse must be at least as long as either leg. If you enter a hypotenuse smaller than the leg, c² − a² becomes negative and there is no real square root — such a triangle cannot exist. Double-check which side is the hypotenuse (the longest one, opposite the right angle).
How are the two angles computed — do I need a trig table?
No table needed. The angle opposite leg a is ∠A = atan(a / b) (the inverse tangent), and ∠B = 90° − ∠A. The widget uses Math.atan2(a, b) so b = 0 doesn't divide-by-zero. A 3-4-5 triangle has angles 36.87° and 53.13°.
Does Pythagoras only apply to right triangles?
Yes. For non-right triangles you need the more general Law of Cosines: c² = a² + b² − 2ab·cos(C), where C is the angle opposite side c. When C = 90°, cos(C) = 0 and the formula collapses back to the Pythagorean theorem.
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.
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.
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.