Skip to main content
ponderloop

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

Type any two of the three sides and leave the one to find empty. The hypotenuse c is the longest side, opposite the right angle.

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

  1. Square each leg: a² = 6² = 36 and b² = 9² = 81.
  2. Add the squares: c² = a² + b² = 36 + 81 = 117.
  3. Take the square root: c = √117 = 10.816654… (a square root that is not a whole number never ends).
  4. Round to 2 decimal places: c ≈ 10.82 in.
  5. Area = ½ × a × b = ½ × 6 × 9 = 27 in².
  6. Perimeter = a + b + c = 6 + 9 + 10.816654… ≈ 25.82 in.
  7. Angle A (opposite a) = arctan(a ÷ b) = arctan(6 ÷ 9) ≈ 33.69°, and angle B = 90° − A ≈ 56.31°.
  8. Altitude to the hypotenuse h = a × b ÷ c = 6 × 9 ÷ 10.816654… ≈ 4.99 in.

Pythagorean theorem formulas and the example worked

Each result is the calculator’s own answer for legs a = 6 in and b = 9 in; ≈ marks a value rounded to 2 decimal places.
To findFormulaYou needResult for a = 6, b = 9
Hypotenuse cc = √(a² + b²)Both legs≈ 10.82 in
Leg aa = √(c² − b²)c and b, with c longer than b6 in for c = 10 in, b = 8 in
Leg bb = √(c² − a²)c and a, with c longer than a8 in for c = 10 in, a = 6 in
AreaA = ½ × a × bBoth legs27 in²
PerimeterP = a + b + cAll three sides≈ 25.82 in
Angle A (opposite a)A = arctan(a ÷ b)Both legs≈ 33.69°
Angle B (opposite b)B = 90° − AAngle A≈ 56.31°
Altitude to the hypotenuseh = a × b ÷ cBoth legs and c≈ 4.99 in

Pythagorean triples up to 100

All 52 whole-number triples with a < b < c ≤ 100, found by searching every pair of legs; 16 are primitive (no common factor), the rest are multiples of them.
abcPerimeterType
34512Primitive
6810242 × (3, 4, 5)
5121330Primitive
91215363 × (3, 4, 5)
8151740Primitive
121620484 × (3, 4, 5)
7242556Primitive
152025605 × (3, 4, 5)
102426602 × (5, 12, 13)
20212970Primitive
182430726 × (3, 4, 5)
163034802 × (8, 15, 17)
212835847 × (3, 4, 5)
12353784Primitive
153639903 × (5, 12, 13)
243240968 × (3, 4, 5)
9404190Primitive
2736451089 × (3, 4, 5)
1448501122 × (7, 24, 25)
30405012010 × (3, 4, 5)
2445511203 × (8, 15, 17)
2048521204 × (5, 12, 13)
284553126Primitive
33445513211 × (3, 4, 5)
4042581402 × (20, 21, 29)
36486014412 × (3, 4, 5)
116061132Primitive
166365144Primitive
2560651505 × (5, 12, 13)
335665154Primitive
39526515613 × (3, 4, 5)
3260681604 × (8, 15, 17)
42567016814 × (3, 4, 5)
485573176Primitive
2470741682 × (12, 35, 37)
2172751683 × (7, 24, 25)
45607518015 × (3, 4, 5)
3072781806 × (5, 12, 13)
48648019216 × (3, 4, 5)
1880821802 × (9, 40, 41)
138485182Primitive
367785198Primitive
4075852005 × (8, 15, 17)
51688520417 × (3, 4, 5)
6063872103 × (20, 21, 29)
398089208Primitive
54729021618 × (3, 4, 5)
3584912107 × (5, 12, 13)
57769522819 × (3, 4, 5)
657297234Primitive
28961002244 × (7, 24, 25)
608010024020 × (3, 4, 5)

Square a corner: the 3-4-5 rule and its multiples in feet

Measure the first leg along one edge from the corner, the second along the other, then check the diagonal between the two marks. The diagonal is computed by the calculator.
TripleMark along edge 1Mark along edge 2Diagonal must beWhich triple
3-4-53 ft4 ft5 fta primitive triple
6-8-106 ft8 ft10 ft2 × the triple 3-4-5
9-12-159 ft12 ft15 ft3 × the triple 3-4-5
12-16-2012 ft16 ft20 ft4 × the triple 3-4-5
5-12-135 ft12 ft13 fta primitive triple
10-24-2610 ft24 ft26 ft2 × the triple 5-12-13
8-15-178 ft15 ft17 fta primitive triple

Diagonals of common rectangles

Each diagonal is the calculator’s answer for the width and height in the second column, rounded to 2 decimal places.
RectangleWidth × heightDiagonalArea
US Letter paper8.5 × 11 in≈ 13.9 in93.5 in²
A4 paper (ISO 216)210 × 297 mm≈ 363.74 mm62,370 mm²
Plywood sheet, 4 ft by 8 ft4 × 8 ft≈ 8.94 ft32 ft²
Door opening, 36 in by 80 in36 × 80 in≈ 87.73 in2,880 in²
Poster, 24 in by 36 in24 × 36 in≈ 43.27 in864 in²
Room, 12 ft by 16 ft12 × 16 ft20 ft192 ft²
Room, 3 m by 4 m3 × 4 m5 m12 m²
Square, 1 by 11 × 1 cm≈ 1.41 cm1 cm²

TV and monitor sizes: width and height from the diagonal

Sold sizes are the diagonal of the picture. Width × height in inches, to 1 decimal place, from the calculator’s screen mode.
Diagonal16:9 (width × height)4:3 (width × height)21:9 (width × height)
32 in27.9 × 15.7 in25.6 × 19.2 in29.4 × 12.6 in
43 in37.5 × 21.1 in34.4 × 25.8 in39.5 × 16.9 in
50 in43.6 × 24.5 in40 × 30 in46 × 19.7 in
55 in47.9 × 27 in44 × 33 in50.6 × 21.7 in
65 in56.7 × 31.9 in52 × 39 in59.7 × 25.6 in
75 in65.4 × 36.8 in60 × 45 in68.9 × 29.5 in
85 in74.1 × 41.7 in68 × 51 in78.1 × 33.5 in

Two special right triangles

Both are solved by the calculator to 4 decimal places.
TriangleKnown sidesSides (short leg, long leg, hypotenuse)Acute angles
45-45-90 (isosceles right)Both legs 11, 1, 1.414245° and 45°
30-60-90Hypotenuse 2, short leg 11, 1.7321, 230° and 60°

How to square a corner with the 3-4-5 rule

  1. 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).
  2. 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.
  3. 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.
  4. 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.
  5. 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

More: Geometry and measurementAll math & numbersAll toolsHome & DIY calculators