Pythagorean Theorem Calculator
Calculate the hypotenuse or a leg of a right triangle using the Pythagorean theorem. Also get area, perimeter, and angles. With Pythagorean triples.
- Data verified · June 2026
- Edited by Martín Rodríguez
- Formula verified by automated tests
- Private — runs on your device
See step-by-step calculation
See this calculation step by step
See period-by-period detail
How to use this calculator
Follow this tool’s steps, then review its formula, assumptions, and limits below.
When to use this calculator
- Check if a wall or piece is square (if 3-4-5 gives exactly 5, it's at a right angle).
- Calculate a TV or monitor diagonal to see if it fits in furniture.
- Find the length of a ladder leaning against a wall given height and base distance.
- Calculate the straight-line distance between two coordinate points.
- Solve geometry homework for right triangle problems.
Famous Pythagorean Triples (Whole-Number Right Triangles)
| Leg a | Leg b | Hypotenuse c | Note |
|---|---|---|---|
| 3 | 4 | 5 | Base triple — 3-4-5 construction method |
| 5 | 12 | 13 | Primitive triple |
| 6 | 8 | 10 | Multiple of 3-4-5 (×2) |
| 7 | 24 | 25 | Primitive triple |
| 8 | 15 | 17 | Primitive triple |
| 9 | 40 | 41 | Primitive triple |
| 20 | 21 | 29 | Primitive triple |
Fuente: Wolfram MathWorld — Pythagorean Theorem (mathworld.wolfram.com)
How it works
The Theorem
a² + b² = c²Where:
Finding the Hypotenuse
c = sqrt(a² + b²)Finding a Leg
a = sqrt(c² - b²)
b = sqrt(c² - a²)Famous Pythagorean Triples
Sets of three whole numbers that perfectly satisfy the theorem:
| a | b | c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 6 | 8 | 10 (multiple of 3-4-5) |
| 7 | 24 | 25 |
| 8 | 15 | 17 |
| 9 | 40 | 41 |
| 20 | 21 | 29 |
The 3-4-5 triple is the most useful in construction. If a triangle has sides of exactly 3, 4, and 5 units, it's a right triangle -- this lets you verify right angles with just a tape measure.
Generating Triples (Euclid's Formula)
a = m² - n²
b = 2mn
c = m² + n²With m > n > 0 as integers. Example: m=2, n=1 gives (3, 4, 5).
Calculating Angles
Once you have all three sides, the acute angles are:
alpha = arctan(a / b)
beta = arctan(b / a)
alpha + beta = 90° (all three angles sum to 180°, one is 90°)Real-World Applications
Construction
Checking right angles: measure 3 ft and 4 ft along two walls -- the diagonal must be exactly 5 ft. If it's 4.95 or 5.05, the walls aren't square. Used by carpenters and builders for 2,500 years.
Ladder length: ladder against a wall, height 4 m, base 1 m from wall. Length = sqrt(1² + 4²) = sqrt(17) = 4.12 m.
Screen Sizes
A 55-inch TV means 55" diagonal. For a 16:9 aspect ratio:
Distance Between Points
Straight-line distance between two points (x1, y1) and (x2, y2):
d = sqrt((x2 - x1)² + (y2 - y1)²)This is the Pythagorean theorem applied to Cartesian coordinates. In 3D:
d = sqrt((x2-x1)² + (y2-y1)² + (z2-z1)²)The Converse Theorem
If a² + b² = c² in a triangle (where c is the longest side), then the triangle IS a right triangle. This lets you verify right angles by measuring sides only.
Generalization: Law of Cosines
For non-right triangles:
c² = a² + b² - 2ab x cos(C)If C = 90°, then cos(C) = 0 and it reduces to the Pythagorean theorem.
Common Mistakes
1. Applying it to non-right triangles: only works with a 90-degree angle. For others, use the Law of Cosines.
2. Confusing legs with hypotenuse: the hypotenuse is ALWAYS the longest side, opposite the right angle.
3. Forgetting the square root: c² = a² + b², so c = sqrt(a² + b²) (not a + b).
4. Adding before squaring: (a + b)² != a² + b². Square each leg separately, then add.
5. Mixing units: if one leg is in meters and another in centimeters, convert first.
Example: Diagonal of a 4 x 3 meter room
c = sqrt(a² + b²).c = sqrt(4² + 3²) = sqrt(16 + 9) = sqrt(25) = 5.5² = 25 = 16 + 9 = 4² + 3² confirmed.(4 x 3) / 2 = 6 m².Frequently asked questions
Does the Pythagorean Theorem work for any triangle?
c² = a² + b² - 2ab x cos(C). The Pythagorean theorem is a special case of the Law of Cosines when C = 90 degrees (because cos(90) = 0).How do I know if a triangle is a right triangle without measuring angles?
a² + b² = c² where c is the longest side, then the triangle is a right triangle. Example: triangle with sides 5, 12, 13. Check: 5² + 12² = 25 + 144 = 169 = 13². Confirmed. Very useful in construction for verifying walls are square.What is a Pythagorean triple?
a² + b² = c². The most famous: (3,4,5), (5,12,13), (8,15,17), (7,24,25). Multiplying any triple by an integer k gives another triple: (6,8,10), (9,12,15), etc. They can be generated with Euclid's formula: a = m²-n², b = 2mn, c = m²+n².What is the diagonal of a 55-inch TV?
sqrt(16² + 9²) = sqrt(337) = 18.36, then multiply by 16 for width and by 9 for height. Result: width = 47.9" = 121.7 cm, height = 27" = 68.5 cm.How do I use the theorem for a ladder against a wall?
sqrt(5² - 1²) = sqrt(24) = 4.9 m. For safety, the recommended angle is 75 degrees from the ground, which means base = height / 4.Does the Pythagorean theorem work in 3 dimensions?
(x1,y1,z1) and (x2,y2,z2) is d = sqrt((x2-x1)² + (y2-y1)² + (z2-z1)²). It's proven by applying the theorem twice (first in XY plane, then incorporating Z). Also useful for calculating the diagonal of a box: d = sqrt(length² + width² + height²).Who discovered the Pythagorean theorem?
How many proofs of the Pythagorean theorem exist?
Sources & references
Methodology & trust
Math calculator with its formula verified automatically against Common Core State Standards — 8.G.B.6 & 8.G.B.7 (Pythagorean Theorem), per our editorial policy and methodology.
Updated: June 2026. Parameters are verified periodically against the cited sources.
Calculations run 100% in your browser. We do not store or transmit your data.
Indicative results. For critical decisions, consult a professional.
📌 How to cite this calculator
Rodríguez, M. (2026). Pythagorean Theorem Calculator. Hacé Cuentas. https://hacecuentas.com/en/pythagorean-theorem-calculator
@misc{hacecuentas_pythagorean_theorem_calculator_2026,
author = {Rodríguez, Martín},
title = {{Pythagorean Theorem Calculator}},
year = {2026},
howpublished = {\url{https://hacecuentas.com/en/pythagorean-theorem-calculator}},
note = {Hacé Cuentas}
} Content licensed under CC-BY 4.0 — reuse it citing the source with a link to Hacé Cuentas.