Trigonometry

Pythagorean Theorem Calculator

This Pythagorean theorem calculator finds the missing side of a right triangle with a2+b2=c2a^2 + b^2 = c^2, so the hypotenuse is c=a2+b2c = \sqrt{a^2 + b^2}.

Try
°
°

Enter any two values with at least one side, or all three sides to check for a right angle. Sides accept fractions (3/4), mixed numbers (5 1/2) and, in feet or inches, feet and inches (5' 6").

Result

Hypotenuse c: c = 5

Hypotenuse c

c = 5

A = 36.86989765°, B = 53.13010235°, C = 90°

Areaab / 2
6
Perimeter
12
Altitude to the hypotenuseh = ab / c
2.4
Hypotenuse segmentsThe altitude splits c into a²/c (next to B) and b²/c (next to A)
1.8 and 3.2
Inradius rr = ab / (a + b + c) = (a + b − c)/2
1
Circumradius RHalf the hypotenuse
2.5
sin A, cos A, tan Aa/c, b/c, a/b
0.6, 0.8, 0.75

The legs are 3 and 4 and the hypotenuse is 5. The acute angles are 36.86989765° and 53.13010235°, the area is 6 and the altitude to the hypotenuse is 2.4.

Angles are in degrees. The two acute angles always add up to 90°.

3, 4 and 5 are whole numbers, so they form a Pythagorean triple.

The right triangle (right angle at C)
ABCa = 3b = 4c = 5
Sides and angles
PartValueSource
Leg a3Given
Leg b4Given
Hypotenuse c5Calculated
Angle A36.86989765°Calculated
Angle B53.13010235°Calculated
Angle C90°Right angle
Step-by-step working (6 steps)
  1. Label the triangle

    The right angle is C, the hypotenuse c is opposite it, and legs a and b are opposite angles A and B. Given: a = 3, b = 4.

  2. Pythagorean theorem for the hypotenuse

    c=a2+b2=32+42=5c = \sqrt{a^2 + b^2} = \sqrt{3^2 + 4^2} = 5
  3. TOA: tangent gives angle A

    tan A = opposite / adjacent = a / b.

    A=tan−1⁡34=36.86989765∘A = \tan^{-1}\frac{3}{4} = 36.86989765^{\circ}
  4. The acute angles add up to 90°

    B=90∘−36.86989765∘=53.13010235∘B = 90^{\circ} - 36.86989765^{\circ} = 53.13010235^{\circ}
  5. Area and perimeter

    K=12ab=12⋅3⋅4=6,P=a+b+c=12K = \tfrac{1}{2}ab = \tfrac{1}{2} \cdot 3 \cdot 4 = 6, \quad P = a + b + c = 12
  6. Check with the Pythagorean theorem

    a2+b2=25=c2=25a^2 + b^2 = 25 = c^2 = 25

Add an angle to solve the whole right triangle with SOH-CAH-TOA, or enter three sides to check for a right angle.

By Hira Noor, mathematicianLast reviewed Free, no sign-up, runs in your browserReport a problem

How to use this calculator

  1. This right triangle calculator puts the right angle at C. The hypotenuse c is the side opposite it and always the longest side; leg a is opposite angle A and leg b is opposite angle B.
  2. To find a missing side, enter the other two sides and leave the third blank. Two legs give the hypotenuse; the hypotenuse and one leg give the other leg.
  3. To solve with an angle, enter one side and one acute angle in degrees. Two angles alone are not enough, because they fix the shape but not the size.
  4. To check whether a triangle is right-angled, fill in all three sides with the longest one in c.
  5. Pick a length unit if you want one. Sides accept decimals, fractions (3/4), mixed numbers (5 1/2) and, in feet or inches, feet and inches such as 5' 6 1/2".
  6. Open the steps to see each substitution into the theorem or the trig ratio, or tap a quick pick such as 3-4-5 or 5-12-13 above the form.

Formulas

Pythagorean theorem

a2+b2=c2,c=a2+b2,a=c2−b2,b=c2−a2a^2 + b^2 = c^2, \quad c = \sqrt{a^2 + b^2}, \quad a = \sqrt{c^2 - b^2}, \quad b = \sqrt{c^2 - a^2}

Plain-text formula: a^2 + b^2 = c^2, c = √(a^2 + b^2), a = √(c^2 − b^2), b = √(c^2 − a^2)

a, b
the legs, the two sides that meet at the right angle
c
the hypotenuse, the side opposite the right angle

The square of the hypotenuse equals the sum of the squares of the legs. Rearrange it to find whichever side is missing: add the squares for the hypotenuse, subtract them for a leg.

SOH-CAH-TOA

sin⁡A=ac,cos⁡A=bc,tan⁡A=ab\sin A = \frac{a}{c}, \quad \cos A = \frac{b}{c}, \quad \tan A = \frac{a}{b}

Plain-text formula: sin A = a/c, cos A = b/c, tan A = a/b

Sine is opposite over hypotenuse, cosine is adjacent over hypotenuse, tangent is opposite over adjacent. Use them when a side and an angle are known, or the inverse functions to find an angle from two sides.

Area, altitude and radii

K=ab2,hc=abc,r=a+b−c2,R=c2K = \frac{ab}{2}, \quad h_c = \frac{ab}{c}, \quad r = \frac{a + b - c}{2}, \quad R = \frac{c}{2}

Plain-text formula: K = (ab)/2, h_c = (ab)/c, r = (a + b − c)/2, R = c/2

The legs are perpendicular, so they serve as base and height. The circumscribed circle has the hypotenuse as its diameter.

Reading the result

Check that the answer makes sense: the hypotenuse is always the longest side, the larger acute angle is opposite the longer leg, and A + B = 90°.

When the sides are whole numbers, decimals or fractions, the side found with the Pythagorean theorem is also shown in exact form. For legs 1 and 1, a 45-45-90 triangle, the hypotenuse is exactly √2 ≈ 1.414213562, not a rounded decimal.

In feet or inches the sides are also listed in feet and inches, rounded to the nearest 1/16 inch, which is what a tape measure shows. For triangles that are not right-angled, use the triangle calculator, which applies the laws of sines and cosines.

How to solve a right triangle with the Pythagorean theorem

Label the sides first: the hypotenuse c is opposite the right angle, and the legs a and b form the right angle. Then square the two sides you know.

To find the hypotenuse, add the squares and take the square root. For legs 6 and 8: 62+82=36+64=1006^2 + 8^2 = 36 + 64 = 100, so c=100=10c = \sqrt{100} = 10.

To find a leg, subtract the square of the known leg from the square of the hypotenuse. For c = 13 and b = 5: 132−52=169−25=14413^2 - 5^2 = 169 - 25 = 144, so a=144=12a = \sqrt{144} = 12.

With one side and an angle, use SOH-CAH-TOA instead. For c = 10 and A = 30°: a=10sin⁡30°=5a = 10 \sin 30° = 5 and b=10cos⁡30°≈8.660254038b = 10 \cos 30° \approx 8.660254038, and B = 90° − 30° = 60°.

On a handheld calculator, type the squares and the square root in that order, for example √(6² + 8²), or use the scientific calculator with sqrt(6^2+8^2).

The hypotenuse c is opposite the right angle. For angle A, leg a is the opposite side and leg b the adjacent side.

Pythagorean triples

A Pythagorean triple is three whole numbers that fit a2+b2=c2a^2 + b^2 = c^2. Any multiple of a triple is also a triple, so 3-4-5 gives 6-8-10, 9-12-15 and 30-40-50. Type any row below into the calculator to see the angles. For the full list up to 1,000, a checker and Euclid’s formula, see the Pythagorean triples calculator.

Common Pythagorean triples
Legs a and bHypotenuse cCheckSmaller acute angle
3, 459 + 16 = 2536.86989765°
5, 121325 + 144 = 16922.61986495°
8, 151764 + 225 = 28928.07248694°
7, 242549 + 576 = 62516.26020471°
20, 2129400 + 441 = 84143.60281897°
9, 404181 + 1600 = 168112.68038349°

The 3-4-5 rule for squaring corners

Builders use the converse of the Pythagorean theorem to check that a corner is square. Measure 3 units along one wall and 4 along the other; if the diagonal between the marks is exactly 5, the corner is 90°. Scale it up for accuracy: 6-8-10 or 9-12-15 feet on a deck or slab.

For a whole rectangle, measure both diagonals; they are equal only when every corner is square. To find the diagonal you should get, enter the length and width as the two legs. A 12 ft by 16 ft room has a diagonal of exactly 20 ft.

With feet and inches, choose feet as the unit and type sides such as 9' 6" and 12' 3 1/2". The calculator gives the diagonal as 15 ft 6 7/16 in, to the nearest 1/16 inch.

Worked example

A ladder 6 m long with its foot 1.5 m from a wall

How high up the wall does the ladder reach, and what angle does it make with the ground?

  1. Put angle A at the foot of the ladder and the right angle C at the base of the wall. The ladder is the hypotenuse c = 6, the distance along the ground is leg b = 1.5 and the height on the wall is leg a.
  2. Pythagorean theorem: a=62−1.52=33.75=3215≈5.809475019a = \sqrt{6^2 - 1.5^2} = \sqrt{33.75} = \tfrac{3}{2}\sqrt{15} \approx 5.809475019.
  3. The angle at the top of the ladder: sin⁡B=1.56=0.25\sin B = \frac{1.5}{6} = 0.25, so B ≈ 14.47751219°.
  4. The angle with the ground is A = 90° − B ≈ 75.52248781°.

Answer: The ladder reaches about 5.81 m up the wall and makes an angle of about 75.5° with the ground.

Frequently asked questions

How do I find the hypotenuse?

Enter both legs. The hypotenuse is c=a2+b2c = \sqrt{a^2 + b^2}; for legs 3 and 4 it is 9+16=5\sqrt{9 + 16} = 5.

How do I find a missing leg (find a or find b)?

Enter the hypotenuse and the other leg. Then a=c2−b2a = \sqrt{c^2 - b^2}; for c = 13 and b = 12 the missing leg is a = 5.

Is the 3-4-5 rule the Pythagorean theorem?

Yes. 3-4-5 is the smallest whole-number solution of a2+b2=c2a^2 + b^2 = c^2, since 9+16=259 + 16 = 25. Builders use it, through the converse of the theorem, to check that a corner is exactly 90°.

What is the 30-60-90 rule for right triangles?

In a 30-60-90 triangle the sides are in the ratio 1:3:21 : \sqrt{3} : 2. The side opposite 30° is half the hypotenuse, and the side opposite 60° is 3\sqrt{3} times that.

How do I check if three sides make a right triangle?

Square the two shorter sides and add them. If the total equals the square of the longest side, the triangle is right-angled; if it is larger the triangle is acute, and if smaller it is obtuse. Enter all three sides above to check.

Can I enter feet and inches or fractions?

Yes. Sides accept fractions such as 3/4 and mixed numbers such as 5 1/2. Choose feet or inches as the unit to type lengths such as 5' 6 1/2"; the answers are listed in feet and inches to the nearest 1/16 inch.

Do sin, cos and tan only work for right triangles?

SOH-CAH-TOA as side ratios only works in a right triangle. For other triangles, the laws of sines and cosines use the same functions; the triangle calculator applies them.

Triangle Calculator

Solve any triangle from SSS, SAS, ASA, AAS or SSA, with law of sines and cosines steps and the ambiguous case.

Trigonometry

Trigonometry Calculator

All six trig functions of an angle, or the angle from a ratio, with exact values, quadrant and steps.

Trigonometry

Polar to Rectangular Calculator

Polar ↔ rectangular (Cartesian) conversion with steps, quadrant reasoning, exact values and exponential form.

Algebra & Equations

Scientific Calculator

Type or tap expressions with exact fractions, memory, variables, constants and complex mode.

Tools

Learn more: To find a side or an angle by hand with SOH CAH TOA, read how to use sin, cos and tan.

Sources and further reading

  1. Algebra and Trigonometry 2e, Section 7.2: Right Triangle Trigonometry (opens in a new tab), OpenStax, Rice University
  2. Pythagorean Triple (opens in a new tab), Wolfram MathWorld (Eric W. Weisstein)
  3. Euclid’s Elements, Book I, Propositions 47 and 48 (the theorem and its converse), Classic text; translation by T. L. Heath, Cambridge University Press, 1908

Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?