Pythagorean theorem (right triangle) calculator

See a right triangle diagram and the three square area model side by side. Solve for any side, check if three sides form a right triangle, or find the distance between two points—always with exact radicals plus an optional decimal approximation.

The tool highlights a\u00b2+b\u00b2=c\u00b2 visually and keeps your steps for copying as LaTeX or SVG. Calculations stay in your browser.

Other languages: en | ja | es
Solve for

We sort the largest value as c (hypotenuse) before checking a\u00b2+b\u00b2=c\u00b2.

dx = x2 - x1, dy = y2 - y1, distance d = \u221a(dx\u00b2 + dy\u00b2).

How to use
  1. Pick a mode (solve, check, or distance).
  2. Enter two sides or two points; example chips fill them for you.
  3. Results, diagrams, and steps update automatically. Copy the URL, LaTeX, or SVG for class use.
Display & accessibility settings

Result

Enter two sides to solve for the third, or load an example.

Exact radicals are kept internally; decimals are for display only.

Diagrams

Right triangle (a, b, c)
Right triangle diagram Shows legs a and b with a right angle and hypotenuse c.
Square area model (a\u00b2, b\u00b2, c\u00b2)
Area model for a\u00b2 + b\u00b2 = c\u00b2 Three squares built on each side; a\u00b2 and b\u00b2 combine to c\u00b2.

Steps

What this means

FAQ

Which side is the hypotenuse?

The hypotenuse is opposite the right angle and is always the longest side. If your c is shorter than a or b, the triangle is impossible.

Why do we square the legs in a\u00b2+b\u00b2=c\u00b2?

Squaring converts each side length into the area of a square on that side. The two smaller square areas add up exactly to the big square on c.

Why does a square root appear at the end?

You add areas (a\u00b2+b\u00b2) first, then take the square root to get back to a length. That is why radicals show up in the answer.

How do I handle decimals or fractions?

Type 0.3 or 1/2. Internally we keep an exact fraction and only round for display, so you avoid accumulated error.

How strict is the right-triangle check?

Fractions are compared exactly. Decimal-only inputs use a tiny tolerance; the difference is shown so you can judge \"almost\" cases.

Is my input sent anywhere?

No. Everything runs locally, including the diagrams and exports.

Related calculators