Free tool
Pythagorean Theorem Calculator
Find a missing side of a right triangle from the other two, with exact roots, simplified radicals, area, perimeter and angles. Working shown.
- The missing side
- –
- As a decimal
- –
- The squared value it comes from
- –
- Area of the triangle
- –
- Perimeter
- –
- Acute angles (A opposite a, B opposite b)
- –
The working
Assumptions and limits
Every figure comes from the numbers you enter. Where a rule of thumb is used, it is labeled as one.
- The triangle has a right angle. The relationship used is a² + b² = c², with c the longest side.
- The missing side is computed exactly from the squared values, so a perfect square gives an exact answer and anything else is shown as a simplified radical and a decimal marked ≈.
- Area = a × b ÷ 2 and perimeter = a + b + c. Values that depend on an irrational side are rounded to six decimals.
- Angles use inverse sine in floating point and are rounded to four decimals.
- Every side is positive and in the same unit. No unit conversion is done.
Runs entirely in your browser. Nothing you type or upload is sent to our servers.
How the missing side is found
In a right triangle the two legs meet at the right angle and the hypotenuse is the side across from it. The square of the hypotenuse equals the sum of the squares of the legs: a² + b² = c². To find c, add the squares and take the square root. To find a leg, subtract the square of the known leg from c² and take the square root of what is left.
The calculator keeps every number as an exact fraction until the very last step. That is why 1.5 and 2 give exactly 2.5 rather than 2.4999999999, and why a root such as √75 is shown in its simplified form, 5√3, instead of only as a decimal.
Worked example 1: both legs known
A ramp rises 3 feet over a horizontal run of 4 feet. How long is the sloped surface?
- c² = a² + b² = 3² + 4² = 9 + 16 = 25.
- c = √25 = 5 feet.
- Area = 3 × 4 ÷ 2 = 6 square feet. The angle at the bottom of the ramp, opposite the 3-foot rise, is arcsin(3 ÷ 5) = 36.8699°.
The three sides 3, 4 and 5 are whole numbers, so they form a Pythagorean triple.
Worked example 2: hypotenuse and one leg known
A 10-foot ladder reaches a point on a wall, and its base is 5 feet from the wall. How high up the wall does it reach?
- b² = c² − a² = 10² − 5² = 100 − 25 = 75.
- b = √75 = √(25 × 3) = 5√3.
- As a decimal, 5√3 ≈ 8.660254 feet.
Enter 5 in the a box, 10 in the c box and leave b empty to see these lines.
Checks and cautions
- The longest side should always be c. If your answer for a leg is longer than the hypotenuse, the entries were swapped.
- Do not add the legs to get the hypotenuse. In the 3-4-5 triangle, 3 + 4 = 7, but the hypotenuse is 5. The legs have to be squared first.
- If you need a side measured to the nearest 1/16 inch, convert the decimal result with the Unit Converter or the Decimal to Fraction Calculator.
Related calculators
Roots that do not come out even are simplified step by step in the Square Root Calculator. For the area of a floor, roof or lot built from right triangles, use the Square Footage Calculator. Circles have their own formulas in the Circumference Calculator.
Frequently asked questions
What does the Pythagorean theorem calculator do?
It finds the missing side of a right triangle when you know the other two. Enter any two of leg a, leg b and the hypotenuse c, leave the third box empty, and it solves a² + b² = c² for the empty one. It also gives the area, the perimeter and the two acute angles.
Which side is the hypotenuse?
The hypotenuse is the side opposite the right angle, and it is always the longest side of a right triangle. Enter it as c. The other two sides, the legs, can go in either the a or the b box, because the equation a² + b² = c² treats them the same way.
Why is my answer a square root such as √74?
Most pairs of sides do not give a perfect square. For legs of 5 and 7, c² = 25 + 49 = 74, and 74 is not a perfect square, so the exact length is √74. The calculator shows that exact form, simplified when possible (√75 becomes 5√3), and a decimal marked ≈ to six places.
What is a Pythagorean triple?
A set of three whole numbers a, b and c that satisfy a² + b² = c². The smallest example is 3, 4 and 5, because 9 + 16 = 25. Multiplying all three by the same whole number gives another: 6, 8 and 10. When your three sides are whole numbers that fit, the calculator says so.
Why does it say the hypotenuse must be longer?
If you enter c and one leg, c² − leg² has to be positive, which means c must exceed that leg. A hypotenuse of 5 with a leg of 12 would require a negative square, so no right triangle has those sides. Fill in exactly two boxes, and make sure c is the longest.
How are the angles calculated?
Each acute angle comes from the inverse sine of its opposite leg divided by the hypotenuse, for example angle A = arcsin(3 ÷ 5) = 36.8699° for a 3-4-5 triangle. These angles are computed in floating point and shown to four decimals. The other acute angle makes the two add to 90°.
Can I use decimals or different units?
Yes, decimals are fine, and the answer is exact for decimal inputs. Use the same unit for every side. The result is in that unit and the area is in its square. The calculator does not convert units, so convert feet and inches to one unit first with the unit converter.
Is anything I type saved or sent anywhere?
No. The calculation runs in your browser, and nothing you enter is stored or sent to our servers. Only a count that the tool was used is recorded, without any numbers from the form.
Link to this tool
Found it useful? Copy a link for your page, newsletter or documentation.
Get new tools and guides by email
Optional. The tool above works without signing up.
More free tools
Browse all everyday calculators or the full list of free tools.
- Square Root Calculator with Cube RootFind the square root and cube root of any number, in simplified radical form and as a decimal to the places you choose. Perfect squares are exact.
- Quadratic Formula CalculatorSolve ax² + bx + c = 0 with the quadratic formula: real and complex roots, discriminant, vertex and every step shown. Exact for rational roots.
- Long Division CalculatorDivide whole numbers with a quotient and remainder or a decimal answer, with every written step of the long division shown. Big numbers supported.
- Circumference CalculatorFind the circumference, area, radius and diameter of a circle from any one of them, with exact answers in terms of π and the working shown.
- Gravel CalculatorEstimate gravel in cubic yards, cubic meters and tons for a driveway, path or base layer, with the density you enter and an optional extra allowance.
- Mulch CalculatorFind how many cubic yards and bags of mulch a garden bed needs from its size and depth, plus how much area a cubic yard covers at that depth.