Pythagorean theorem calculator

Pick which side you need and type the two you know. Pythagorean theorem: a² + b² = c². With a = 3 and b = 4 you get c = 5. With a = 5 and b = 12 you get c = 13.

The angle between a and b must be right. Hypotenuse c is always the longest side.

Input

Result

Choose which side to find and enter the two known lengths.

How it works

The Pythagorean theorem: in a right triangle a² + b² = c², where c is the side opposite the right angle. Solving for c: c = √(a² + b²). Solving for a: a = √(c² - b²). Same idea for b. With 3 and 4: 9 + 16 = 25, square root 5.

People check a right angle with a 3-4-5 stick, or they find a rectangle diagonal. 3 and 4 are the legs, 5 is longest. 5-12-13 is another clean triple: 25 + 144 = 169. The angle between a and b must be right, or the formula lies.

What are you solving for? has three modes: hypotenuse c when you know a and b, leg a when you know b and c, or b when you know a and c. Type 3 and 4, leave mode c, click Calculate. A comma and a period both parse. c must be longer than the known leg: b = 4 and c = 3 have no result.

Vector length (3, 4) is the same 5, only in coordinates. Sine 3/5 = 0.6 from this triangle lives on the sine page. Area of 3-4-5 is (3 × 4)/2 = 6, another calculator.

Both typed sides share one unit: centimeters with centimeters. The header switch does not turn a 3 into inches. Without two known sides the calculator waits.

a = 6 and b = 8 give c = 10, a doubled 3-4-5. a = 8 and b = 15 give c = 17. With a = 9 and c = 15 you want b: √(225 - 81) = 12.

Formula

a² + b² = c²

c = √(a² + b²) ··· a = √(c² − b²) ··· b = √(c² − a²)

How to use

  1. Pick What are you solving for?: c when you know a and b, a when you know b and c, or b when you know a and c.
  2. Type the two known sides. For c, leave 3 in leg a and 4 in leg b.
  3. Click Calculate. 3 and 4 give c = 5. 5 and 12 give c = 13.
  4. c must be longer than the known leg. b = 4 and c = 3 is not a right triangle.
  5. Vector (3, 4) of length 5 lives on vector length. This page stays with three triangle sides.

a, b, and c on 3-4-5

The Pythagorean theorem here is a² + b² = c². 3 and 4 give c = 5. 5 and 12 give c = 13. The angle between a and b is right.

a
A leg. 3 in the 3-4-5 triangle. In mode a you compute √(c² − b²).
b
The other leg. 4. Doubling 3-4-5 gives 6-8-10.
c
The hypotenuse, the longest side. 5, 13 or 17. A c shorter than a leg will not run.

Examples

Example 1

  • a: 3
  • b: 4
  • Find c

c = 5

The most famous Pythagorean triple.

Example 2

  • a: 5
  • b: 12

c = 13

Another clean triple.

Example 3

  • b: 8
  • c: 10

a = 6

√(100 − 64) = √36 = 6.

Example 4

  • a: 6
  • c: 10

b = 8

The 6-8-10 triangle (double 3-4-5).

Related calculators

Frequently asked questions

What is c when a = 3 and b = 4?

The hypotenuse is 5. 9 + 16 = 25, square root 5. That is the 3-4-5 triangle, the first clean example.

What is c at 5 and 12?

You get 13. 25 + 144 = 169. Another clean Pythagorean triple, same formula a² + b² = c².

How do I find a leg when I know c?

Pick mode a or b. a = √(c² − b²). With c = 15 and a = 9 you get b = 12. c must be the longest side.

Must the angle between a and b be right?

Yes. a² + b² = c² is for 90°. Any other angle needs cosine, another calculator.

Do 6 and 8 give 10?

Yes. That is a doubled 3-4-5. 36 + 64 = 100, square root 10. Scale does not break the right angle.

Where is the length of vector (3, 4)?

On the vector-length page. There √(9+16) = 5 as well, from coordinates x and y, not from triangle sides.

What is the area of triangle 3-4-5?

The area is 6, because (3 × 4)/2. This calculator finds the missing side, not the area. Area lives on another page.

Does b = 4 and c = 3 work?

No. The hypotenuse must be longest. 3 cannot carry a leg of 4, and the calculator refuses that layout.

What is c at 8 and 15?

You get 17. 64 + 225 = 289, square root 17. Another integer triple.

Does sine 3/5 belong here?

No. 3/5 = 0.6 is on sine, sides mode. Here you hunt the missing side, not a ratio.

Knowledge sources

The calculator computes the same formula as the definition below.

Page updated in 2026.