Pythagorean Theorem Calculator — Solve Any Right Triangle
Type any two sides of a right triangle. Get the third side, both angles, perimeter, and area.
- Side a
- —
- Side b
- —
- Side c
- —
- Angle α
- —
- Angle β
- —
- Right angle
- —
- Perimeter
- —
- Area
- —
What is pythagorean theorem calculator?
The Pythagorean theorem is the single most-cited identity in school geometry: in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides — a² + b² = c². The legs (a and b) are the two sides that form the right angle; the hypotenuse (c) is the side opposite the right angle and is always the longest side of the triangle. This calculator works in both directions: given two of the three sides, it solves for the third.
To use the calculator, type any two of the three sides and leave the unknown one blank. The calculator detects which side is missing and computes it directly. When both known sides are whole numbers and the answer is irrational, you’ll see an exact form line underneath — like √41 or 3√2 — which is the form most geometry teachers want on a worksheet. The result panel also includes both non-right angles in degrees, the perimeter, the area, and a scaled drawing of your triangle so you can sanity-check the shape.
Privacy is the final detail worth naming. Every calculation runs locally in your browser; the side lengths you type never leave your device. There is no server, no API call, no analytics on input values. The only state saved between visits is your unit preference — cm, m, in, or ft — stored in localStorage so the toggle remembers your last choice.
When to use a pythagorean theorem calculator
- Geometry homework — solve for the missing side — A textbook problem gives two sides of a right triangle and asks for the third. Type the two known sides; the third appears at the top of the result panel along with the exact form (e.g., √41) for the work-shown answer your teacher is looking for.
- Carpentry and framing — squaring a corner — Measure two leg lengths along a wall and a floor; the diagonal that proves the corner is square is the hypotenuse. The 3-4-5 trick scales: if your legs are 6 ft and 8 ft, the diagonal should read 10 ft. Flip the unit selector to ft or in and read the answer directly.
- TV or monitor diagonal from width and height — Spec sheets advertise the diagonal — that's the hypotenuse. If you know the visible width and height of a screen (or a TV box), enter them as a and b and read the diagonal as c. The same calculation works the other way: enter the diagonal and one dimension to recover the other.
How to use the Pythagorean Theorem Calculator — Solve Any Right Triangle
- Pick your unit — Choose cm, m, in, or ft from the segmented control. The choice is cosmetic — it appends the unit suffix to every displayed length and is remembered for next time. Switching units does not convert the numbers you've typed.
- Enter any two of the three sides — Type whichever two side lengths you know. Leave the unknown side blank — the calculator detects which side is missing and solves for it. Fill all three sides if you want a quick check; the calculator shows c computed from a and b in that case.
- Read the missing side at the top of the result — The headline shows which side was solved for and its value. When both known sides are whole numbers and the answer is irrational, an exact-form line (like √41 or 3√2) appears underneath.
- Read angles, perimeter, area, and the diagram — The stats list shows both non-right angles (in degrees), the perimeter, and the area. Next to it, a scaled SVG drawing of your triangle with side labels and the right-angle square at the corner. For very-different leg lengths the drawing is clamped to a minimum aspect for legibility — a (not to scale) note appears when this triggers.
Worked examples
a = 3 cm, b = 4 cm
Input: Side a 3 cm, Side b 4 cm
Output: Hypotenuse c = 5 cm The canonical Pythagorean triple — 3, 4, 5 — and the easiest way to verify the calculator is working.
a = 5 m, c = 13 m
Input: Side a 5 m, Side c 13 m
Output: Side b = 12 m A 5-12-13 triple, solved for a leg instead of the hypotenuse. Leave b blank, fill a and c.
a = 4 in, b = 5 in
Input: Side a 4 in, Side b 5 in
Output: Hypotenuse c ≈ 6.4031 in (exact: √41) An irrational result with both legs as integers — the calculator shows both the decimal answer (rounded to 4 places) and the simplified surd.
Frequently asked questions
What is the Pythagorean theorem?
a² + b² = c². It only holds for right triangles — triangles with one 90° angle — and is one of the oldest and most-used identities in geometry.How do I find the hypotenuse?
c = √(a² + b²). For a 3-4-5 right triangle: √(9 + 16) = √25 = 5. For 4 and 5: √(16 + 25) = √41 ≈ 6.4031. Type the two legs as a and b, leave c blank, and the calculator does the work.How do I find a leg when I know the hypotenuse and the other leg?
a = √(c² − b²). For a 5-12-13 triangle, given c = 13 and b = 5: √(169 − 25) = √144 = 12. Leave the unknown leg blank in the form; the calculator handles either leg-given branch.What does the exact form (√41, 3√2) mean and when does it appear?
k√m) underneath the decimal answer. √41 means the square root of 41, which can't be simplified because 41 has no square factor. 3√2 means three times the square root of 2 — the simplification of √18, since 18 = 9 · 2. Most geometry teachers expect the simplified surd as the work-shown answer; the decimal is for sanity-checking.Does this calculator work for non-right triangles?
c² = a² + b² − 2ab·cos(γ). We may add a separate non-right-triangle calculator in the future, but this tool is right-triangle-only.How are the angles calculated?
arctan: the angle opposite side a is arctan(a/b), and the angle opposite side b is arctan(b/a). The third angle is always 90° because the triangle is right by definition. The calculator uses Math.atan2 internally for numerical stability and reports both angles in degrees, rounded to four decimals.Why does the calculator say the hypotenuse must be longer than both legs?
a² + b² = c² forces it. If c (the side you typed as the hypotenuse) is smaller than or equal to a or b, then the missing leg's square would be zero or negative, which is impossible for a real triangle. When the calculator can't form a valid right triangle from your inputs, it shows that hint instead of returning a misleading answer.Are my numbers stored or sent anywhere?
localStorage, so the toggle remembers your choice next visit.