# Pythagorean theorem calculator

Canonical HTML: https://easycalculatorsonline.com/geometry/pythagorean/

Find the hypotenuse from two perpendicular sides.

Interactive calculations run in your browser. Values below are the published example, not a calculation for your circumstances.

## Calculator inputs

| Input | Example value | Constraints and options |
| --- | --- | --- |
| Leg a | 3 | min: 0.000001. max: 1000000000. step: any |
| Leg b | 4 | min: 0.000001. max: 1000000000. step: any |

**International formulas and units**

Use the units and assumptions stated on this page. Mathematical definitions apply across countries; material, device and measurement conditions remain your inputs.

## Published example result

> Pythagorean theorem
> Hypotenuse: 5
> a² + b²: 25
> Applies only to a right triangle. Both legs must use the same length unit.
> https://easycalculatorsonline.com/geometry/pythagorean/

03 · UNDERSTAND THE METHOD

## How the pythagorean theorem calculator works

The Pythagorean theorem connects the three side lengths of a right triangle. This calculator takes the two legs that meet at the right angle and finds the hypotenuse opposite that angle. It is useful for understanding a rectangle’s diagonal, a perpendicular offset, or a right-triangle problem. The two supplied lengths must use the same unit and must represent perpendicular directions for this calculation to describe the geometry.

### The formula and its variables

c = √(a² + b²)

- **a, b**: Positive lengths of the perpendicular legs.
- **c**: Hypotenuse opposite the right angle.

### The calculation, step by step

1. Identify the right angle and its two adjoining sides. Enter those leg lengths rather than entering one leg and the hypotenuse.
2. Square each leg and add the squared values. This sum has squared length units.
3. Take the positive square root of the sum to return to length units. Compare the answer with each leg; it must be larger than either positive leg.

### A worked example

With legs of 3 units and 4 units, the squared lengths are 9 and 16. Their sum is 25, and the positive square root is 5. The hypotenuse is therefore 5 units. For a rectangle 3 meters wide and 4 meters long, the same calculation gives a diagonal of 5 meters because adjacent edges meet at a right angle.

**Example inputs and calculated output**

| Input or output | Value |
| --- | --- |
| Leg a | 3 |
| Leg b | 4 |
| Hypotenuse | 5 |

### How to read the result and visual

The diagonal in the diagram connects the ends of the two perpendicular legs. The answer describes a straight-line distance, not the distance traveled along both legs. Walking 3 units and then 4 units covers 7 units of route, whereas the straight diagonal between the same endpoints is 5 units in this example.

### Assumptions, rounding, and limitations

The theorem requires a right angle. Applying it to an arbitrary triangle without that condition gives the wrong side length. This form solves only the hypotenuse from two known legs; solving a missing leg requires subtracting squares instead. Inputs are positive lengths, and display rounding does not improve the precision of the measurements.

### Frequently asked questions

### Does the order of the legs matter?

No. Adding their squares gives the same sum whichever leg is entered first.

### Can I use different units for the two legs?

Convert them to one shared length unit before calculating.

### Reference sources

- [OpenStax: the Pythagorean theorem ↗](https://openstax.org/books/prealgebra/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem)

[How we check calculations and what verification covers](https://easycalculatorsonline.com/methodology/)

## Related calculators

[**Triangle side from two sides and angle ↗**

Use the law of cosines with the included angle.](https://easycalculatorsonline.com/geometry/triangle-cosine-side/)[**Triangle area from sides ↗**

Use Heron’s formula when all three side lengths are known.](https://easycalculatorsonline.com/geometry/heron-triangle/)[**Triangle side from two angles ↗**

Use the law of sines with a known side and two angles.](https://easycalculatorsonline.com/geometry/triangle-sine-side/)

[← Explore all calculators](https://easycalculatorsonline.com/#browse)

## Publisher and access

Published by Wolfpack Labs. Free to use; no account or payment required.

[Email wolfpack.labs.in@gmail.com](mailto:wolfpack.labs.in@gmail.com)

[About](https://easycalculatorsonline.com/about/) · [Methodology](https://easycalculatorsonline.com/methodology/) · [Contact](https://easycalculatorsonline.com/contact/) · [Privacy](https://easycalculatorsonline.com/privacy/) · [Terms](https://easycalculatorsonline.com/terms/)
