Pythagorean Theorem Calculator

Free Pythagorean theorem calculator. Find the hypotenuse or a leg of a right triangle, see step-by-step work, formulas, area and perimeter, plus real-world examples.

Full original guide (expanded)

Pythagorean Theorem Calculator

Find the hypotenuse or a missing leg of a right triangle with \(a^2 + b^2 = c^2\). Get step-by-step work, area, perimeter and a quick diagram.

Core Math & Algebra

Interactive right triangle calculator

Choose which side you want to solve for, enter the known sides, and the calculator will:

  • Check that the triangle can be right-angled.
  • Compute the missing side using \(a^2 + b^2 = c^2\).
  • Report area and perimeter.
  • Show clear, step-by-step working.
1. What do you want to calculate?

Leave blank if \(a\) is the unknown side.

Leave blank if \(b\) is the unknown side.

Leave blank if \(c\) is the unknown side.

All sides must use the same unit.

Right triangle diagram

b (base) a (height) c (hypotenuse)

Side \(c\) is always the hypotenuse, opposite the right angle. Sides \(a\) and \(b\) are the legs.

The Pythagorean theorem in a nutshell

The Pythagorean theorem describes the relationship between the sides of a right triangle. If \(a\) and \(b\) are the legs and \(c\) is the hypotenuse (the side opposite the right angle), then

\(a^2 + b^2 = c^2\)

This means that the square of the hypotenuse is equal to the sum of the squares of the other two sides. It is one of the most widely used results in geometry, physics, engineering, navigation and everyday construction.

Solving for different sides

Depending on which side is unknown, you can rearrange the formula:

  • To find the hypotenuse \(c\): \(c = \sqrt{a^2 + b^2}\).
  • To find a leg \(a\): \(a = \sqrt{c^2 - b^2}\).
  • To find the other leg \(b\): \(b = \sqrt{c^2 - a^2}\).

In all cases, \(c\) must be the longest side; otherwise, the triangle cannot be right-angled.

Worked example (3–4–5 triangle)

Suppose you have a right triangle with legs \(a = 3\) and \(b = 4\). The hypotenuse is:

\(c = \sqrt{a^2 + b^2} = \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5.\)

Area and perimeter of a right triangle

Once you know all three sides, you can immediately compute:

  • Area: \(\dfrac{1}{2} a b\).
  • Perimeter: \(P = a + b + c\).

The calculator shows these values automatically, using the same units as your inputs.

When can you use the Pythagorean theorem?

The Pythagorean theorem is only valid for right triangles (one angle is exactly \(90^\circ\)). Common uses include:

  • Finding a ladder length safely reaching a given height.
  • Checking whether a corner is square in construction.
  • Computing the diagonal of a rectangle or screen.
  • Distance between two points on a coordinate grid.

For non-right triangles, you generally need the law of cosines, which reduces to the Pythagorean theorem when the angle is \(90^\circ\).

Connection with the distance formula

In coordinate geometry, the distance between points \((x_1, y_1)\) and \((x_2, y_2)\) is

\(d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.\)

This is just the Pythagorean theorem in disguise: the horizontal and vertical differences are the legs of a right triangle, and the distance is the hypotenuse.

Pythagorean theorem – FAQ

What is the Pythagorean theorem?

It is a statement about the lengths of the sides of a right triangle: the square of the hypotenuse equals the sum of the squares of the legs, \(a^2 + b^2 = c^2\).

How do I know which side is the hypotenuse?

The hypotenuse is always the side opposite the right angle and is always the longest side of a right triangle. In the calculator and formulas on this page, the hypotenuse is always called \(c\).

What units does the calculator use?

You can use any unit of length (meters, centimeters, inches, feet, etc.), as long as all sides use the same unit. The calculator carries the unit through to the results for area and perimeter.

Can the Pythagorean theorem be used in 3D?

Yes, but you apply it step by step. For example, to find the space diagonal of a box with sides \(x\), \(y\), and \(z\), first use the theorem in the base to get the diagonal \(d = \sqrt{x^2 + y^2}\), then use it again with \(d\) and \(z\) to get the full diagonal \(\sqrt{x^2 + y^2 + z^2}\).

What if my numbers don’t satisfy a² + b² = c² exactly?

In real measurements you usually have rounding and small errors. The calculator reports how closely \(a^2 + b^2\) matches \(c^2\) and flags impossible combinations (for example, if a leg is longer than the hypotenuse).

Frequently Asked Questions

How accurate is the Pythagorean theorem calculator?

The calculator uses standard floating-point arithmetic with user-selectable rounding. For classroom work and most engineering or construction tasks, this is more than sufficient. If you need very high precision, increase the number of decimal places or work symbolically.

Can this tool prove that a triangle is right-angled?

If you already know all three side lengths, you can check whether they satisfy \(a^2 + b^2 \approx c^2\). If the equality holds to within measurement error, the triangle is right-angled. The calculator reports the difference between \(a^2 + b^2\) and \(c^2\) so you can make an informed judgement.

What are classic Pythagorean triples?

Pythagorean triples are integer solutions to \(a^2 + b^2 = c^2\), such as (3, 4, 5), (5, 12, 13) or (8, 15, 17). They are especially useful when you want exact lengths without rounding, for example in carpentry or layout work.


Audit: Complete
Formula (LaTeX) + variables + units
This section shows the formulas used by the calculator engine, plus variable definitions and units.
Formula (extracted LaTeX)
\[','\\]
','\
Formula (extracted text)
\(c = \sqrt{a^2 + b^2} = \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5.\)
Formula (extracted text)
\(d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.\)
Variables and units
  • No variables provided in audit spec.
Sources (authoritative):
Changelog
Version: 0.1.0-draft
Last code update: 2026-01-19
0.1.0-draft · 2026-01-19
  • Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido on 2026-01-19
Profile · LinkedIn
Formulas

(Formulas preserved from original page content, if present.)

Version 0.1.0-draft
Citations

Add authoritative sources relevant to this calculator (standards bodies, manuals, official docs).

Changelog
  • 0.1.0-draft — 2026-01-19: Initial draft (review required).