Pythagorean Theorem Calculator

Enter any two sides and the calculator finds the third

By Drew Budwin · Last updated July 2026 · Methodology

Leave exactly one field blank. It will be solved automatically.

Embed this calculator

Add it to your website or blog

Embed this calculator

Theme

Paste this code into your website's HTML where you want the calculator to appear. It adds a small credit link back to CalcTray. Please keep it. How embedding works.

Optional: auto-resize iframe to fit content

Add this snippet to your page so the iframe height adjusts automatically after each calculation:

Pythagorean Theorem Calculator Formula

The Pythagorean theorem relates the three sides of a right triangle.

a² + b² = c²

a and b are the two legs of the right triangle, c is the hypotenuse (the side opposite the right angle).

Rearranged to solve for any unknown side.

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

When solving for a leg, the hypotenuse must be longer than the other leg.

How to Use This Calculator

  1. Enter the values you know for two of the three sides (a, b, or c).
  2. Leave exactly one field blank. That is the side the calculator will solve for.
  3. Side c is always the hypotenuse (the longest side, opposite the right angle). Sides a and b are the two legs.
  4. Click Calculate to find the missing side plus area, perimeter, and all interior angles.
  5. Copy the URL to share your result. The link auto-fills the inputs and calculates on load.

Frequently Asked Questions

What is the Pythagorean theorem?

The Pythagorean theorem states that in a right triangle, the square of the hypotenuse (c) equals the sum of the squares of the other two sides (a and b): a² + b² = c². It is one of the most fundamental relationships in geometry.

Which side is the hypotenuse?

The hypotenuse is always the longest side of a right triangle and is the side opposite the 90° angle. In this calculator, it is labeled c.

What if the hypotenuse is shorter than a leg?

That is geometrically impossible. The hypotenuse must always be the longest side. The calculator will show an error if you enter a hypotenuse value that is not longer than the known leg.

Are the results exact?

Results are displayed with up to 4 decimal places. For the classic 3-4-5 triangle, all values are exact integers. For non-integer results, the displayed values are rounded for readability.

Does this calculator handle non-right triangles?

No. This calculator only works for right triangles (triangles with one 90° angle). For the area of any triangle given three sides, use the triangle area calculator, which uses Heron's formula.

What are Pythagorean triples?

Pythagorean triples are sets of three positive integers that satisfy a² + b² = c². Common examples include 3-4-5, 5-12-13, 8-15-17, and 7-24-25. Any multiple of a triple (e.g., 6-8-10) is also a valid triple.

Where does the Pythagorean theorem come up outside of math class?

Construction workers use the 3-4-5 rule to check square corners. Electricians run cable diagonally through walls. TV screens are measured by diagonal — a 55-inch screen has a 55-inch diagonal, and the actual width and height depend on the aspect ratio. Enter the two legs to find any diagonal.

What is the distance formula, and how does it relate to the Pythagorean theorem?

The distance between two points (x₁, y₁) and (x₂, y₂) is √((x₂−x₁)² + (y₂−y₁)²). That is just the Pythagorean theorem: horizontal difference is one leg, vertical difference is the other, and the straight-line distance is the hypotenuse. Use the slope calculator to get distance alongside slope.

Can I use this calculator to find a leg length from the hypotenuse and one leg?

Yes. Enter the hypotenuse in the c field and the known leg in a or b, leaving the other blank. The calculator solves using b = √(c² − a²). The only requirement is that the hypotenuse must be longer than the known leg.

Further Reading

Related Calculators