Pythagorean Theorem Calculator
A right triangle with legs a = 6 in and b = 9 in has a hypotenuse c = √(6² + 9²) = √117 ≈ 10.82 in, an area of 27 in², a perimeter of about 25.82 in, acute angles of about 33.69° and 56.31°, and an altitude to the hypotenuse of about 4.99 in. Type any two of a, b and c to find the third (a hypotenuse that is not the longest side gets a clear error), test three sides for a right angle, or switch to a rectangle or screen diagonal; every length keeps your unit and the working shows each square, sum and rounded square root.
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
c = √(a² + b²)
c ≈ 10.82 in
Right triangle with a = 6 in, b = 9 in and c ≈ 10.82 in.
- Leg a
- 6 in
- Leg b
- 9 in
- Hypotenuse c
- ≈ 10.82 in
- Area
- 27 in²
- Perimeter
- ≈ 25.82 in
- Angle A (opposite a)
- ≈ 33.69°
- Angle B (opposite b)
- ≈ 56.31°
- Right angle C
- 90°
- Altitude to the hypotenuse
- ≈ 4.99 in
- Whole-number (Pythagorean) triple
- No: the sides are not all whole numbers
The square root of 117 never ends, so every value marked ≈ is rounded to 2 decimal places. Pick more places above for more digits.
The working
- Square each leg: a² = 6² = 36 and b² = 9² = 81.
- Add the squares: c² = a² + b² = 36 + 81 = 117.
- Take the square root: c = √117 = 10.816654… (a square root that is not a whole number never ends).
- Round to 2 decimal places: c ≈ 10.82 in.
- Area = ½ × a × b = ½ × 6 × 9 = 27 in².
- Perimeter = a + b + c = 6 + 9 + 10.816654… ≈ 25.82 in.
- Angle A (opposite a) = arctan(a ÷ b) = arctan(6 ÷ 9) ≈ 33.69°, and angle B = 90° − A ≈ 56.31°.
- Altitude to the hypotenuse h = a × b ÷ c = 6 × 9 ÷ 10.816654… ≈ 4.99 in.
Pythagorean theorem formulas and the example worked
| To find | Formula | You need | Result for a = 6, b = 9 |
|---|---|---|---|
| Hypotenuse c | c = √(a² + b²) | Both legs | ≈ 10.82 in |
| Leg a | a = √(c² − b²) | c and b, with c longer than b | 6 in for c = 10 in, b = 8 in |
| Leg b | b = √(c² − a²) | c and a, with c longer than a | 8 in for c = 10 in, a = 6 in |
| Area | A = ½ × a × b | Both legs | 27 in² |
| Perimeter | P = a + b + c | All three sides | ≈ 25.82 in |
| Angle A (opposite a) | A = arctan(a ÷ b) | Both legs | ≈ 33.69° |
| Angle B (opposite b) | B = 90° − A | Angle A | ≈ 56.31° |
| Altitude to the hypotenuse | h = a × b ÷ c | Both legs and c | ≈ 4.99 in |
Pythagorean triples up to 100
| a | b | c | Perimeter | Type |
|---|---|---|---|---|
| 3 | 4 | 5 | 12 | Primitive |
| 6 | 8 | 10 | 24 | 2 × (3, 4, 5) |
| 5 | 12 | 13 | 30 | Primitive |
| 9 | 12 | 15 | 36 | 3 × (3, 4, 5) |
| 8 | 15 | 17 | 40 | Primitive |
| 12 | 16 | 20 | 48 | 4 × (3, 4, 5) |
| 7 | 24 | 25 | 56 | Primitive |
| 15 | 20 | 25 | 60 | 5 × (3, 4, 5) |
| 10 | 24 | 26 | 60 | 2 × (5, 12, 13) |
| 20 | 21 | 29 | 70 | Primitive |
| 18 | 24 | 30 | 72 | 6 × (3, 4, 5) |
| 16 | 30 | 34 | 80 | 2 × (8, 15, 17) |
| 21 | 28 | 35 | 84 | 7 × (3, 4, 5) |
| 12 | 35 | 37 | 84 | Primitive |
| 15 | 36 | 39 | 90 | 3 × (5, 12, 13) |
| 24 | 32 | 40 | 96 | 8 × (3, 4, 5) |
| 9 | 40 | 41 | 90 | Primitive |
| 27 | 36 | 45 | 108 | 9 × (3, 4, 5) |
| 14 | 48 | 50 | 112 | 2 × (7, 24, 25) |
| 30 | 40 | 50 | 120 | 10 × (3, 4, 5) |
| 24 | 45 | 51 | 120 | 3 × (8, 15, 17) |
| 20 | 48 | 52 | 120 | 4 × (5, 12, 13) |
| 28 | 45 | 53 | 126 | Primitive |
| 33 | 44 | 55 | 132 | 11 × (3, 4, 5) |
| 40 | 42 | 58 | 140 | 2 × (20, 21, 29) |
| 36 | 48 | 60 | 144 | 12 × (3, 4, 5) |
| 11 | 60 | 61 | 132 | Primitive |
| 16 | 63 | 65 | 144 | Primitive |
| 25 | 60 | 65 | 150 | 5 × (5, 12, 13) |
| 33 | 56 | 65 | 154 | Primitive |
| 39 | 52 | 65 | 156 | 13 × (3, 4, 5) |
| 32 | 60 | 68 | 160 | 4 × (8, 15, 17) |
| 42 | 56 | 70 | 168 | 14 × (3, 4, 5) |
| 48 | 55 | 73 | 176 | Primitive |
| 24 | 70 | 74 | 168 | 2 × (12, 35, 37) |
| 21 | 72 | 75 | 168 | 3 × (7, 24, 25) |
| 45 | 60 | 75 | 180 | 15 × (3, 4, 5) |
| 30 | 72 | 78 | 180 | 6 × (5, 12, 13) |
| 48 | 64 | 80 | 192 | 16 × (3, 4, 5) |
| 18 | 80 | 82 | 180 | 2 × (9, 40, 41) |
| 13 | 84 | 85 | 182 | Primitive |
| 36 | 77 | 85 | 198 | Primitive |
| 40 | 75 | 85 | 200 | 5 × (8, 15, 17) |
| 51 | 68 | 85 | 204 | 17 × (3, 4, 5) |
| 60 | 63 | 87 | 210 | 3 × (20, 21, 29) |
| 39 | 80 | 89 | 208 | Primitive |
| 54 | 72 | 90 | 216 | 18 × (3, 4, 5) |
| 35 | 84 | 91 | 210 | 7 × (5, 12, 13) |
| 57 | 76 | 95 | 228 | 19 × (3, 4, 5) |
| 65 | 72 | 97 | 234 | Primitive |
| 28 | 96 | 100 | 224 | 4 × (7, 24, 25) |
| 60 | 80 | 100 | 240 | 20 × (3, 4, 5) |
Square a corner: the 3-4-5 rule and its multiples in feet
| Triple | Mark along edge 1 | Mark along edge 2 | Diagonal must be | Which triple |
|---|---|---|---|---|
| 3-4-5 | 3 ft | 4 ft | 5 ft | a primitive triple |
| 6-8-10 | 6 ft | 8 ft | 10 ft | 2 × the triple 3-4-5 |
| 9-12-15 | 9 ft | 12 ft | 15 ft | 3 × the triple 3-4-5 |
| 12-16-20 | 12 ft | 16 ft | 20 ft | 4 × the triple 3-4-5 |
| 5-12-13 | 5 ft | 12 ft | 13 ft | a primitive triple |
| 10-24-26 | 10 ft | 24 ft | 26 ft | 2 × the triple 5-12-13 |
| 8-15-17 | 8 ft | 15 ft | 17 ft | a primitive triple |
Diagonals of common rectangles
| Rectangle | Width × height | Diagonal | Area |
|---|---|---|---|
| US Letter paper | 8.5 × 11 in | ≈ 13.9 in | 93.5 in² |
| A4 paper (ISO 216) | 210 × 297 mm | ≈ 363.74 mm | 62,370 mm² |
| Plywood sheet, 4 ft by 8 ft | 4 × 8 ft | ≈ 8.94 ft | 32 ft² |
| Door opening, 36 in by 80 in | 36 × 80 in | ≈ 87.73 in | 2,880 in² |
| Poster, 24 in by 36 in | 24 × 36 in | ≈ 43.27 in | 864 in² |
| Room, 12 ft by 16 ft | 12 × 16 ft | 20 ft | 192 ft² |
| Room, 3 m by 4 m | 3 × 4 m | 5 m | 12 m² |
| Square, 1 by 1 | 1 × 1 cm | ≈ 1.41 cm | 1 cm² |
TV and monitor sizes: width and height from the diagonal
| Diagonal | 16:9 (width × height) | 4:3 (width × height) | 21:9 (width × height) |
|---|---|---|---|
| 32 in | 27.9 × 15.7 in | 25.6 × 19.2 in | 29.4 × 12.6 in |
| 43 in | 37.5 × 21.1 in | 34.4 × 25.8 in | 39.5 × 16.9 in |
| 50 in | 43.6 × 24.5 in | 40 × 30 in | 46 × 19.7 in |
| 55 in | 47.9 × 27 in | 44 × 33 in | 50.6 × 21.7 in |
| 65 in | 56.7 × 31.9 in | 52 × 39 in | 59.7 × 25.6 in |
| 75 in | 65.4 × 36.8 in | 60 × 45 in | 68.9 × 29.5 in |
| 85 in | 74.1 × 41.7 in | 68 × 51 in | 78.1 × 33.5 in |
Two special right triangles
| Triangle | Known sides | Sides (short leg, long leg, hypotenuse) | Acute angles |
|---|---|---|---|
| 45-45-90 (isosceles right) | Both legs 1 | 1, 1, 1.4142 | 45° and 45° |
| 30-60-90 | Hypotenuse 2, short leg 1 | 1, 1.7321, 2 | 30° and 60° |
How to square a corner with the 3-4-5 rule
- Mark the corner and the first leg. Mark the corner point. Measure 3 ft along the first edge from it and mark that point. For a more accurate result use a bigger multiple that still fits, such as 6-8-10 or 9-12-15 (15 ft).
- Mark the second leg. Measure 4 ft along the second edge, roughly at a right angle to the first, and mark that point. For 6-8-10 that is 6 ft and 8 ft; for 5-12-13 it is 5 ft and 12 ft.
- Measure the diagonal. Measure straight between the two marks. A square corner needs exactly 5 ft for 3-4-5, 10 ft for 6-8-10 and 13 ft for 5-12-13, the lengths the calculator finds from the two legs.
- Adjust until it matches. If the diagonal is longer than it should be, the corner is wider than 90°, so swing the second edge in toward the first; if it is shorter, the corner is narrower than 90°, so open it up. Re-measure each time. A diagonal of 60.25 in instead of 60 in on a 36 in by 48 in corner means ≈ 90.5° at the corner.
- Check the other diagonal. For a whole rectangle, repeat from the opposite corner or measure both corner-to-corner diagonals: they are equal only when the shape is a true rectangle with square corners.
Frequently asked questions
- How do you find the hypotenuse of a right triangle?
- Square both legs, add the squares and take the square root: c = √(a² + b²). For legs of 6 in and 9 in: 6² + 9² = 117, and √117 = 10.82 in, rounded to 2 decimals (10.8167 in to 4). The calculator writes this working out under the result, with the rounding shown.
- How do you find a missing leg?
- Subtract the square of the known leg from the square of the hypotenuse, then take the square root: a = √(c² − b²). With c = 10 in and b = 8 in: 10² − 8² = 100 − 64 = 36, and √36 = 6 in exactly. Leave the box for the leg you want empty and fill in the other two.
- Why does the calculator say the hypotenuse must be longer than the leg?
- The hypotenuse is the side opposite the right angle and is always the longest side, because c² = a² + b² is bigger than a² or b² alone. If you type a hypotenuse that is not longer than the leg you gave, there is no right triangle, so the calculator stops with a message instead of a number. For a leg of 6 in and a hypotenuse of 5 in: “The hypotenuse c (5 in) must be longer than leg a (6 in). In a right triangle the hypotenuse is the longest side, so c² = a² + b² cannot hold with c this short. Check which side is the longest.” A hypotenuse equal to the leg is rejected too (“The hypotenuse c (6 in) must be longer than leg a (6 in).”), since the other leg would be 0.
- Does the Pythagorean theorem work for any triangle?
- No, only for right triangles. For any other triangle the law of cosines, c² = a² + b² − 2ab cos C, gives the third side from two sides and the angle between them; it reduces to the Pythagorean theorem when C is 90°, because cos 90° = 0. The triangle calculator solves oblique triangles from sides and angles; the check mode here tells you whether three sides make a right, acute or obtuse triangle.
- How can I tell whether three sides make a right triangle?
- Sort them, square the two shorter sides, add, and compare with the square of the longest. If they are equal the triangle is right (the converse of the theorem). 3, 4, 5 gives 25 ft² = 25 ft²: a right triangle. If the sum is bigger, the triangle is acute (4, 5, 6: ≈ 82.82° at the largest angle); if smaller, obtuse (2, 3, 4: ≈ 104.48°). The order you type does not matter (13, 5, 12 is a right triangle), and the test is exact, so 1.5, 2, 2.5 is a right triangle with no rounding doubt. Sides that cannot close, such as 2, 3, 7, give “Not a triangle”.
- What is the 3-4-5 rule and how do I square a corner with it?
- A triangle with sides 3, 4 and 5 has a right angle between the 3 and the 4, so measuring 3 ft along one edge, 4 ft along the other and checking that the diagonal between the marks is exactly 5 ft makes the corner square. Bigger multiples are more accurate because a small marking error matters less: 10 ft for 6-8-10, 15 ft for 9-12-15, 13 ft for 5-12-13. Use the layout table above and the how-to steps.
- How far off square is my corner if the diagonal is a little long?
- Type the three lengths into the check mode. On a 36 in by 48 in corner the diagonal should be 60 in; a reading of 60.25 in is 0.25 in too long, which makes the corner ≈ 90.5° (obtuse triangle). The same quarter inch matters less on a longer layout line, which is why large multiples of 3-4-5 are used.
- What is a Pythagorean triple?
- Three whole numbers a, b, c with a² + b² = c², such as 3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29. A search of every pair of legs finds 52 triples with c up to 100, of which 16 are primitive; the biggest primitive one is 65-72-97 and the last triple in the table is 60-80-100. Multiplying a triple by any whole number gives another (3-4-5 gives 6-8-10, 9-12-15, …). The full list is in the table above, and the calculator tells you when your sides form one.
- How do I find the diagonal of a rectangle, a door or a sheet of plywood?
- The diagonal splits the rectangle into two right triangles with the width and height as legs, so d = √(width² + height²). A 4 ft by 8 ft sheet has a diagonal of ≈ 8.94 ft; a 12 in by 8 in rectangle has ≈ 14.42 in. Use the rectangle mode, and compare diagonals to check that a frame is square.
- How do I find the width and height of a 55 inch TV?
- TVs are sold by the diagonal of the picture. A 55 in screen at 16:9 is 47.94 in wide and 26.96 in high, found from width = diagonal × 16 ÷ √(16² + 9²) and height = diagonal × 9 ÷ √(16² + 9²). At 4:3 the same 55 in diagonal is 44 in by 33 in. The table above lists common sizes; the frame is larger than the picture, so leave extra room.
- What is the altitude to the hypotenuse?
- It is the perpendicular from the right angle to the hypotenuse. Since the area is ½ab and also ½ch, the altitude is h = ab ÷ c: 6 × 9 ÷ 10.82 = 4.99 in for the example. It is always shorter than either leg.
- Can I use it for a box or room diagonal in 3D?
- Apply the theorem twice. For a box 12 by 8 by 5 in, first take the diagonal of the base, 14.4222 in; that and the height 5 are the legs of a second right triangle whose hypotenuse, the space diagonal, is 15.2643 in (using the 4-decimal figure; keep more digits for a long chain, since each rounding adds a tiny error).
- Which units can I use, and are areas in square units?
- Millimetres, centimetres, metres, inches or feet. The unit is a label: type every length in the same unit, and it is carried to each result, squared for areas (27 in² for the example). The calculator never converts between units, so if one side is in feet and the other in inches, change one first.
- How accurate is the result, and why are some values marked ≈?
- Lengths are read as exact decimals and squared and added as fractions, so the right-angle test and every sum are exact. A square root that is not a whole number never ends, so it is calculated to 30 decimals and rounded for display to the places you choose (0 to 6); every value that is rounded is marked ≈, and values that come out exact, such as √64 = 8, are not. Angles are marked ≈ unless they are whole to the rounding shown.
- Is anything I type sent anywhere?
- No. The numbers are used only in your browser to work out the result and are not sent anywhere.
How it works
In a right triangle with legs a and b and hypotenuse c, a² + b² = c² (Euclid, Elements I.47; the converse, I.48, is the right-angle test). Lengths you type are read as exact decimals with the shared decimal parser (src/lib/decimal.ts) and combined as fractions of whole numbers, so squares, sums and differences carry no floating-point error. A square root is taken as the integer square root of the value scaled by 10^60, which gives 30 exact decimals rounded down; when squaring that integer gives the value back exactly the root is exact, otherwise it is shown rounded half up to the places you pick with a ≈ mark. Mode 1: the missing side is c = √(a² + b²), or a = √(c² − b²) and b = √(c² − a²) when c is given; c must be longer than the known leg, otherwise there is no right triangle and the calculator reports that instead. Area = ½ab; perimeter = a + b + c; angle A = arctan(a ÷ b) and B = 90° − A; the altitude to the hypotenuse is h = ab ÷ c, because the area is both ½ab and ½ch. Mode 2 sorts three sides x ≤ y ≤ z, requires x + y > z, and compares x² + y² with z² exactly: equal means a right triangle, greater acute, smaller obtuse; angles come from the law of cosines, arccos((p² + q² − r²) ÷ 2pq), and the reference length for a square corner is √(x² + y²). Mode 3 gives the rectangle diagonal d = √(w² + h²). Mode 4 gives a screen’s width = d × rw ÷ √(rw² + rh²) and height = d × rh ÷ √(rw² + rh²) for the aspect ratio rw:rh. The unit is only a label and is squared for areas; nothing is converted. The triples table is found by searching every pair of whole-number legs a < b up to 100 for a whole-number hypotenuse c ≤ 100 and is not typed. Everything runs in your browser and nothing you type is sent anywhere.
Sources
- Pythagorean theorem, Wikipedia
- Euclid’s Elements, Book I, Proposition 47 (the theorem) and 48 (its converse), D. E. Joyce, Clark University
- Pythagorean triple, Wikipedia
- Right triangle (altitude to the hypotenuse), Wikipedia
- Law of cosines, Wikipedia
- Aspect ratio (image), Wikipedia
- Paper size (ISO 216 and North American sizes), Wikipedia
More free tools
- Area CalculatorPick a shape (rectangle, triangle, circle, trapezoid, ellipse, polygon, ring and more) and get its area and perimeter, with the formula and working.
- Stair CalculatorFind risers, treads, exact riser height, run, stair angle and stringer length from the total rise, with an IRC model-code check. Inches or metric.
- Distance and Midpoint CalculatorDistance between two points in 2D or 3D in exact radical form like 5√2 plus decimal, the midpoint as fractions, slope and line equation, with a plot.
- Circle CalculatorEnter a radius, diameter, circumference or area and get the other three, plus arc length, sector area and chord for a central angle, with the working.
- Angle ConverterConvert degrees, radians (as exact multiples of π), gradians, turns, arcminutes, arcseconds, milliradians and NATO mils, or DMS to decimal degrees.
- Trig CalculatorSin, cos, tan, csc, sec and cot of any angle in degrees or radians, plus asin, acos and atan, with exact radical values for special angles.
More: Geometry and measurementAll math & numbersAll toolsHome & DIY calculators