# Pythagorean Theorem Calculator

- **URL:** https://codeasystem.com/calculators/geometry/pythagorean-theorem-calculator/
- **Category:** geometry
- **Description:** Solve right triangles: find the hypotenuse from two legs, or the missing leg from hypotenuse and one leg.
- **Primary output:** Hypotenuse (c): 5

## Inputs
- Solve for (name: `mode`, type: select)
- Leg a (name: `legA`, type: number, example: 3)
- Leg b (name: `legB`, type: number, example: 4)
- Hypotenuse (c) (name: `hypotenuse`, type: number, example: 5)

## Outputs
- Hypotenuse (c): 5
- Hypotenuse²: 25
- Check: 3² + 4² = 5²

## Formula / methodology
```
c = √(a² + b²)   b = √(c² − a²)
```

In any right triangle, the square of the hypotenuse equals the sum of squares of the legs. Finding the hypotenuse adds the squares; recovering a missing leg subtracts them before taking the root.

Leg-solving validates geometry as well as arithmetic: the known hypotenuse must exceed the known leg, otherwise no such right triangle exists and the input is rejected with an explanation.

## Assumptions & limitations
- The triangle contains a genuine 90° angle.
- All lengths positive and in consistent units.
- A hypotenuse must be the strictly longest side.

## How to use
1. **Choose what you know**; Two legs → solve for the hypotenuse; hypotenuse plus one leg → solve for the missing leg.
2. **Enter the known lengths**; Same unit throughout; feet with feet, meters with meters.
3. **Read the missing side**; The check row shows the verified equation for confidence.

## Example
Legs of 3 and 4 give a hypotenuse of exactly 5; the most famous Pythagorean triple, used by builders for centuries to square corners.

Result for these inputs:

```
Hypotenuse (c): 5
```

## About this calculator
### The 3-4-5 trick on the job site

Carpenters confirm square corners without levels: mark 3 units along one edge, 4 along the other, and adjust until the diagonal measures exactly 5. Any multiple works (6-8-10), scaling up to foundation layouts where being off by degrees means wasted lumber.

### It generalizes further than triangles

Distance formulas in coordinate geometry, screen diagonal sizing, GPS error budgets and vector magnitudes all rest on this identity. Whenever motion or extent happens along perpendicular axes, the theorem recombines them.

## FAQs
### Does this work for non-right triangles?

No; the theorem requires a 90° angle. For oblique triangles, use the law of cosines instead.

### Why was my leg rejected?

The entered hypotenuse must be longer than the known leg; equal or shorter values cannot form a right triangle.

### Are decimals supported?

Fully; the theorem holds for all real lengths, not just whole-number triples.

### What are Pythagorean triples?

Whole-number solutions like 3-4-5, 5-12-13 and 8-15-17; handy exact checks when estimating.

## Related calculators
- [Triangle Area Calculator](https://codeasystem.com/calculators/geometry/triangle-area-calculator/)
- [Distance Between Two Points Calculator](https://codeasystem.com/calculators/geometry/distance-between-points-calculator/)
- [Roof Pitch Calculator](https://codeasystem.com/calculators/construction/roof-pitch-calculator/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/geometry/pythagorean-theorem-calculator/)
