Pythagorean theorem calculator

📐 Free Geometry Tool

Pythagorean Theorem
Calculator

Solve right triangle side lengths instantly using a² + b² = c² — with step-by-step solutions, an interactive triangle diagram, and real-world geometry insights.

⚡ Fast Geometry Calculations
📚 Student & Engineering Friendly
🔍 Step-by-Step Solutions
Enter any two known sides — leave the unknown field empty
a² + b² = c²

Pythagorean Theorem Calculator: Solve Right Triangles Instantly

The Pythagorean theorem calculator is one of the most essential math tools for students, engineers, architects, and everyday problem-solvers. Whether you need to find the hypotenuse of a right triangle, calculate a missing leg length, verify a triangle’s dimensions, or apply geometry to real-world measurements — this calculator solves it instantly with step-by-step working. Understanding the Pythagorean theorem is foundational to geometry, trigonometry, physics, and countless practical applications.

📐 The theorem in one line: In any right triangle, the square of the hypotenuse (c) equals the sum of squares of the other two sides (a and b): a² + b² = c². Enter any two sides above and the calculator solves for the third.

What is the Pythagorean Theorem?

The Pythagorean theorem states that in a right-angled triangle, the area of the square built on the hypotenuse (the side opposite the right angle) is equal to the sum of the areas of the squares built on the other two sides. Expressed as an equation: a² + b² = c², where c is the hypotenuse and a and b are the legs.

This relationship holds true for every right triangle — no exceptions. It is one of the most widely proven theorems in mathematics, with over 370 distinct proofs documented, including geometric, algebraic, and even trigonometric proofs. President James Garfield of the United States famously developed an original proof in 1876 while serving in Congress.

Understanding Right Triangles

A right triangle is any triangle containing one 90-degree angle (a right angle). The side opposite the right angle is called the hypotenuse — it is always the longest side of the triangle. The other two sides are called legs or catheti. The angles of any triangle sum to 180°, so a right triangle’s remaining two angles always sum to 90° and are both acute (less than 90°).

PartSymbolDefinitionProperty
Leg 1aShorter side adjacent to right anglea < c always
Leg 2bOther shorter side adjacent to right angleb < c always
HypotenusecSide opposite the right angleLongest side; c = √(a²+b²)
Right angle90°The angle between legs a and bAlways exactly 90°

How the Formula Works

The formula a² + b² = c² works because of the geometric relationship between the squares constructed on each side of a right triangle. Visually, if you draw a square on each side of the triangle, the area of the square on the hypotenuse exactly equals the combined area of the squares on the two legs.

Solving for each side:
To find hypotenuse c: c = √(a² + b²)
To find leg a: a = √(c² − b²)
To find leg b: b = √(c² − a²)

Step-by-Step Geometry Examples

📐

Example 1: Find c

a = 3, b = 4. c = √(3² + 4²) = √(9 + 16) = √25 = 5. The famous 3-4-5 right triangle!

📏

Example 2: Find a

b = 12, c = 13. a = √(13² − 12²) = √(169 − 144) = √25 = 5. Another Pythagorean triple.

🏗️

Example 3: Roof pitch

A roof rises 8 ft over a 15 ft horizontal run. Rafter length = √(8² + 15²) = √(64 + 225) = √289 = 17 ft.

📺

Example 4: Screen diagonal

A monitor is 24 in wide and 13.5 in tall. Diagonal = √(24² + 13.5²) = √(576 + 182.25) = √758.25 ≈ 27.5 in.

Real-Life Uses of the Theorem

The Pythagorean theorem appears in an enormous range of practical applications across architecture, engineering, navigation, and everyday measurement:

  • Construction: Carpenters use the 3-4-5 rule to ensure walls and foundations are perfectly square (perpendicular). Laying out a rectangle: if the diagonal measures √(length² + width²), the corners are true right angles.
  • Navigation: Calculating straight-line distances between two points (the distance formula: d = √((x₂−x₁)² + (y₂−y₁)²)) is the Pythagorean theorem applied to coordinate geometry.
  • Architecture: Roof pitch calculations, staircase design (rise and run), and window/door diagonal measurements all rely on the theorem.
  • Screen sizes: TV, monitor, and phone screen sizes are specified by diagonal measurement — calculated directly using the Pythagorean theorem from width and height.
  • Physics: Vector addition, resultant force calculation, and velocity component analysis all use the same geometric relationship.
  • Surveying: Determining land boundary distances and elevation differences over known horizontal distances.

Pythagorean Triples

Pythagorean triples are sets of three positive integers that satisfy a² + b² = c² exactly — producing right triangles with whole-number side lengths. The most famous is (3, 4, 5). Any multiple of a Pythagorean triple is also a triple: (6, 8, 10), (9, 12, 15), (15, 20, 25) etc.

abcVerification
3459 + 16 = 25 ✓
5121325 + 144 = 169 ✓
8151764 + 225 = 289 ✓
7242549 + 576 = 625 ✓
202129400 + 441 = 841 ✓

Distance Formula and Coordinate Geometry

The distance formula for two points (x₁, y₁) and (x₂, y₂) in a coordinate plane is: d = √((x₂−x₁)² + (y₂−y₁)²). This is the Pythagorean theorem applied to the horizontal distance (Δx = x₂−x₁) and vertical distance (Δy = y₂−y₁) between the points — the two legs of the right triangle formed by those distances, with d as the hypotenuse.

This extension gives the Pythagorean theorem extraordinary practical power in mapping, GPS calculations, computer graphics (pixel distance), game development (collision detection), data science (Euclidean distance in machine learning), and 3D geometry where it extends to: d = √(Δx² + Δy² + Δz²).

History of Pythagoras

The theorem bears the name of Pythagoras of Samos, a Greek mathematician and philosopher who lived approximately 570–495 BCE. However, the relationship between the sides of a right triangle was known and used by Babylonian mathematicians over 1,000 years before Pythagoras — the Plimpton 322 tablet (circa 1800 BCE) contains a table of Pythagorean triples. Ancient Egyptian surveyors (called “rope stretchers”) used knotted ropes to lay out 3-4-5 right triangles for precise right angles in construction.

Pythagoras is credited with providing the first rigorous mathematical proof of the theorem, establishing it as a universal geometric law rather than a practical observation. His school, the Pythagoreans, were among the first to treat mathematics as an abstract discipline rather than merely a practical tool.

Related Tools

Frequently Asked Questions

What is the Pythagorean theorem?
The Pythagorean theorem states that in any right triangle, the square of the hypotenuse (the side opposite the 90° angle) equals the sum of the squares of the other two sides. Written as a formula: a² + b² = c², where c is the hypotenuse. This is one of the most fundamental relationships in geometry and applies to every right triangle without exception.
How do I calculate the hypotenuse?
To find the hypotenuse c when you know legs a and b: c = √(a² + b²). Steps: (1) Square side a. (2) Square side b. (3) Add the two squared values. (4) Take the square root of the sum. Example: a=6, b=8 → c = √(36+64) = √100 = 10. In the calculator above, enter values for a and b, leave c blank, and click Solve Triangle.
What is a right triangle?
A right triangle is a triangle with exactly one 90-degree angle. The side opposite this right angle is called the hypotenuse — always the longest side. The other two sides are called legs. The remaining two angles in the triangle are both acute (less than 90°) and together sum to exactly 90°. Right triangles are the foundation of trigonometry (sine, cosine, and tangent are all defined using right triangles).
Can this calculator solve for missing side lengths?
Yes — enter any two known sides and leave the third blank. The calculator automatically detects which side is missing and applies the correct formula: for missing c, it uses c = √(a²+b²); for missing a, it uses a = √(c²−b²); for missing b, b = √(c²−a²). It also validates that your inputs form a valid right triangle (the hypotenuse must be longer than either leg).
What is a² + b² = c²?
This is the standard algebraic expression of the Pythagorean theorem, where a and b are the two legs (shorter sides) of a right triangle and c is the hypotenuse (the longest side, opposite the right angle). It states that the square of the hypotenuse always equals the sum of the squares of the two legs. This relationship defines what makes a triangle a right triangle — if a² + b² = c² is satisfied, the triangle contains a 90° angle.
How accurate is this calculator?
The calculator uses JavaScript’s native Math.sqrt() function which provides IEEE 754 double-precision floating-point accuracy — approximately 15–16 significant digits. Results are rounded to your selected decimal precision (2–6 places). For all educational and most professional applications, this accuracy is more than sufficient. For ultra-high-precision engineering calculations, dedicated CAD software with arbitrary-precision arithmetic should be used.
Can I use decimals?
Yes — all input fields accept decimal values. For example, a = 3.5, b = 7.2 will correctly calculate c = √(3.5² + 7.2²) = √(12.25 + 51.84) = √64.09 ≈ 8.006. You can also control the decimal precision of the output using the Decimal Precision dropdown, choosing between integer output and up to 6 decimal places.
What units are supported?
The calculator supports inches, feet, yards, centimeters, meters, and millimeters. The unit affects how the result is labelled but not the mathematical calculation — all three sides must use the same unit. For cross-unit calculations (e.g., one side in feet and another in inches), convert all measurements to the same unit first before entering them.
Why is the theorem important?
The Pythagorean theorem is fundamental to geometry, trigonometry, physics, engineering, architecture, navigation, and computer science. It enables calculation of distances, verification of right angles in construction, vector calculations in physics, coordinate geometry and the distance formula, 3D space calculations, screen diagonal measurements, GPS and mapping algorithms, and machine learning distance metrics. It is arguably the single most widely applied formula in practical mathematics.
Where is the theorem used in real life?
Everywhere dimensions and distances matter: construction (squaring foundations and walls), carpentry (cutting diagonal braces), architecture (roof pitch, stair design), navigation (GPS distance), screen technology (diagonal measurement), surveying (boundary distances), physics (vector resultants), game development (character movement and collision), data science (Euclidean distance in algorithms), and everyday measurement tasks like determining if a ladder reach is sufficient or how long a cable needs to be across a room.

Solve your triangle now

Free Pythagorean theorem calculator — step-by-step solutions, triangle diagram, and angle calculations. No sign-up required.

📐 Solve Triangle ↑ 📏 Calculate Hypotenuse ↑