Get any side of a right triangle from two known sides
The Pythagorean theorem links the three sides of a right triangle with one simple equation.
This tool lets you start from either two legs or one leg and the hypotenuse, then calculates the missing side and shows how the formula is applied.
Solve hypotenuse or a leg Step by step explanations Compare and save scenarios Copy and export PDF
Outputs
Side a, side b, hypotenuse c
Compare
Save multiple triangles
Guide
Formula, intuition, examples
How to use the Pythagorean Theorem Calculator
1
Choose your solve mode
Select whether you want to find the hypotenuse or a leg.
2
Enter two sides and units
Type the known side lengths and choose cm, m, or inches.
3
Calculate and review
See the missing side value, triangle diagram, and the formula used.
4
Compare or export
Save triangles, compare them, or export a PDF for notes.
Detailed guide and references▶
Why the Pythagorean theorem matters
The Pythagorean theorem is one of the first math relationships where a single equation describes an entire family of shapes.
Any right triangle, no matter how large or small, obeys the same link between its three sides.
In practical terms, that means a single formula helps you size ramps, ladders, sloped roofs, screens, supports, cables, and even digital distances on a grid.
If you know two sides, you do not need to guess the third or draw the triangle to scale. The calculation is enough.
The calculator on this page keeps that relationship front and center.
It focuses only on right triangles, so you can safely assume that the ninety degree angle is in place when you enter your numbers.
Squares on the sides show how a squared plus b squared matches the square on c
Core formula and rearrangements
The classic form of the theorem is written in terms of the two legs and the hypotenuse.
a² + b² = c²
a² + b² = c²
Here a and b are the legs, the sides that meet at the right angle.
The side c is the hypotenuse, which is always opposite the right angle and is always the longest side in the triangle.
In a calculator, it is often more convenient to work with rearranged versions of this same equation.
If the unknown side is the hypotenuse, you keep c on one side and take the square root.
c = √(a² + b²)
If instead the unknown side is a leg, you move that term to one side and again apply a square root.
a = √(c² - b²)
b = √(c² - a²)
The calculator uses these rearranged forms internally.
You do not have to manually isolate the variable each time. You simply tell the tool which side you want to find and it uses the correct version of the equation.
Solve modes in this calculator
To keep things simple, the calculator offers two main solve modes.
Both are based on the same theorem but differ in which side is treated as the unknown.
Hypotenuse from two legs:
You enter a and b as positive lengths.
The tool computes c using c equals the square root of a squared plus b squared.
Leg from hypotenuse and one leg:
You enter a known leg and the hypotenuse c.
The tool computes the missing leg using the square root of c squared minus the known leg squared.
In both modes the calculator checks for basic consistency.
For example, when you ask for a leg, the hypotenuse must be longer than the given leg.
If that condition fails, the triangle would not be a right triangle with real side lengths.
After a successful calculation, the result panel shows the numeric values for a, b, and c, the specific formula used, and a right triangle diagram with the numbers placed on each side.
Units and scaling
The Pythagorean theorem works for any distance unit, as long as all sides use the same unit.
You can enter centimeters, meters, inches, or any other consistent measure.
The calculator treats the numbers you type as pure lengths, then attaches the unit label you select in the units drop down.
It does not convert between systems internally, which keeps the results predictable.
Length units supported: cm, m, in (inches)
All three sides a, b, and c are reported with the same unit
If you need another system, convert your inputs and outputs separately
If you double all lengths in a right triangle, the theorem still holds.
A three four five triangle scaled up by a factor of ten becomes a thirty forty fifty triangle, and the relationship between the squares stays the same.
Geometric intuition behind the theorem
Many illustrations draw a square on each side of a right triangle.
The theorem then says that the area of the large square on the hypotenuse is exactly equal to the sum of the areas of the two smaller squares on the legs.
That picture is helpful for building intuition.
It explains why the formula uses squares of the lengths rather than the lengths themselves.
The areas show how much two leg squares must combine to match the large square attached to the hypotenuse.
In the diagram used on this page, you can imagine sliding cut up pieces of the smaller squares into the larger square without leaving gaps.
Many proofs of the theorem rely on this idea of rearranging equal areas.
When the calculator shows the triangle diagram in the result panel, it is echoing the same geometric picture, just in a compact form.
You see which sides are the legs, which side is the hypotenuse, and how the numeric values relate to one another.
Worked examples
Here are a few classic right triangle examples that you can try directly in the calculator.
Example A, three four five triangle:
Enter a equals 3 and b equals 4 in any unit.
The calculator computes c as square root of 3 squared plus 4 squared which is square root of 9 plus 16, equal to square root of 25, giving c equals 5.
This is the most famous Pythagorean triple.
Example B, leg from hypotenuse 13:
Suppose c equals 13 and one leg is 5.
Choose the leg solve mode, enter side equals 5 and hypotenuse equals 13.
The result is square root of 13 squared minus 5 squared which is square root of 169 minus 25, equal to square root of 144, giving the missing leg 12.
Example C, non integer sides:
Let a equal 2.7 and b equal 6.1.
The tool applies the same formula with decimals and returns a hypotenuse with several decimal places.
You can decide how many decimal places you need for your use case.
Example D, checking a design:
You plan a ramp that rises 0.9 meters over a horizontal run of 3.0 meters.
Enter those values as the legs.
The calculator reports the ramp length as the hypotenuse, which helps you decide if your design fits within material and safety limits.
If the input values do not form a valid right triangle, the calculator alerts you instead of returning a complex number or misleading result.
Common mistakes to avoid
Using the wrong side as the hypotenuse:
The hypotenuse is always opposite the right angle and is always the longest side.
If you assign a shorter side as c, the relationship will not hold.
Forgetting to square the sides:
The theorem uses a squared plus b squared, not a plus b.
Leaving out the squares underestimates the hypotenuse, especially when sides differ a lot.
Mixing units:
If a is in centimeters and b is in meters, the theorem still holds mathematically, but you must convert so all sides share the same unit.
The calculator assumes they already match.
Using it on non right triangles:
The Pythagorean theorem requires a ninety degree angle.
For other triangles, the law of cosines is the appropriate generalization.
Rounding too early:
When doing hand calculations, rounding intermediate squares and sums can introduce noticeable error.
The calculator keeps more precision internally and only rounds the displayed values.
The result notes in the tool highlight some of these points so that each calculation is also a small reminder of good practice.
Πυθαγόρας | Pythagoras
History and proofs at a high level
The relationship between the sides of right triangles was known long before it carried the name of Pythagoras.
Ancient sources suggest that versions of the theorem were used in Babylonian and Indian mathematics for practical surveying and construction.
The theorem is traditionally associated with the Greek mathematician Pythagoras because his school studied it in a more systematic and symbolic way.
Over the centuries many different proofs have been discovered, including geometric rearrangements, algebraic arguments, and approaches based on similarity of triangles.
In modern courses, one of the most common proofs uses two copies of the same right triangle arranged inside a square.
By comparing the total area in two different ways, you can show that the square on the hypotenuse must equal the combined area of the two squares on the legs.
This calculator does not attempt to reproduce full proofs.
Instead it focuses on helping you apply the result reliably, with reminders of the underlying structure whenever you review the step by step solution.
Real world uses beyond homework
Right triangles appear in many practical settings.
Here are several common ways the Pythagorean theorem shows up outside the classroom.
Estimating the length of ladders or supports needed to reach a given height from a safe distance.
Checking that a floor plan corner is square by comparing measured diagonals to the expected value.
Computing screen diagonals from width and height when comparing device sizes.
Finding shortest paths in grid like layouts such as aisles, streets, or pixel coordinates.
Relating horizontal and vertical components of movement in basic physics problems.
In each of these cases, the same simple formula lets you translate between legs and diagonals.
The calculator helps explore different dimensions quickly so that you can focus on practical decisions rather than algebra.
homework
Limits and extensions of the theorem
The Pythagorean theorem is powerful but not universal.
It is tied to flat, Euclidean geometry and to triangles with one right angle.
On curved surfaces such as the surface of a sphere, distances do not follow the same rule.
For acute or obtuse triangles, you need the law of cosines, which introduces the angle explicitly.
Measurement errors in the sides can propagate into the result, so very precise work requires careful input checks.
At the same time, the theorem extends in useful ways.
In coordinate geometry, the distance between two points is computed using a version of the same formula, where differences in x and y act as the legs of an invisible right triangle.
Many distance formulas in analytics, physics, and computer graphics are built on this foundation.
Learning to read the Pythagorean pattern in your own data can make those formulas feel far less mysterious.
Pythagorean theorem illustration from Wikimedia Commons, created and modified by several contributors and used here under the GNU Free Documentation License.
Photos from Pexels by multiple creators, used under the Pexels license.
FAQs
What side can this calculator find▶
It can find the hypotenuse from two legs or a missing leg from the hypotenuse and one leg, as long as the triangle is right angled.
Do I need to pick special units▶
No. You can use centimeters, meters, inches, or any other unit as long as all three sides are in the same unit system.
Can I use this for non right triangles▶
The tool is designed only for right triangles. For other triangle shapes, consider using rules such as the law of cosines.
Key takeaways
The Pythagorean theorem links the squares of all three sides of a right triangle
The hypotenuse is always longer than either leg and sits opposite the right angle
The same formula works for any consistent length unit
The calculator highlights the formula used and a step by step path
Scenario compare and PDF export help with homework, notes, and design checks
Related calculators
Recommended posts
Calculator
Solve modeHypotenuse from two legs
Inputsa = 0, b = 0
Resultc = 0
Side a0
Side b0
Hypotenuse c0
Formula used-
Notes-
Formula Used
c² = a² + b²
Calculation Type
Pythagorean Theorem
Result: c = 0
Step by Step Solution
Step 1:Given: a = 0, b = 0
Step 2:Formula: c² = a² + b²
Step 3:Calculation: c = 0
How to interpret this result
Recent calculations on this device
Share or save
The results shown are for general reference and do not replace engineering or safety checks when those are required.