CCalcNest AI

Pythagorean Theorem Calculator

Find the hypotenuse of a right triangle.

Enter values above — results appear instantly as you type.
AI Insight: This only works for right triangles — the 90-degree corner is what makes a²+b²=c² true. For any other triangle you need the Law of Cosines, and applying Pythagoras to a non-right triangle is one of the most common geometry errors.
Notice: This calculator is provided for educational reference. Results depend entirely on the values you enter, and you should verify any figure used for academic, professional, or safety-critical purposes. See our full disclaimer.
Written with AI assistance and checked by automated validation · Last updated: August 2026 · How we build and check this · Methodology
Looking for a different calculator? Try our AI Finder — describe what you need in plain English. Try AI Finder →

Formula

c = √(a²+b²)

Example

Sides 3,4 → Hypotenuse 5.

Embed this calculator on your site

Add this free calculator to your own website with one line of code. The embedded version is responsive, ad-free, and includes a small attribution link back to CalcNest AI.

<iframe src="https://calcnestai.com/embed/pythagorean-theorem-calculator.html" width="100%" height="700" frameborder="0" style="border: 1px solid #e5e5e5; border-radius: 12px; max-width: 720px;" loading="lazy" title="Pythagorean Theorem Calculator — Free Tool by CalcNest AI"></iframe>

Understanding the Pythagorean Theorem Calculator

A Pythagorean calculator finds the hypotenuse from two perpendicular sides. The theorem holds only for right triangles, and its converse is what makes it practically useful: a triangle whose sides satisfy the relation must contain a right angle.

How it actually works

Enter the two shorter sides. The calculator squares each, sums them, and takes the square root. Sides of 3 and 4 give a hypotenuse of exactly 5.

Common Pythagorean triples
TripleUse
3, 4, 5Squaring corners with a tape
5, 12, 13Alternative proportion
8, 15, 17Longer runs
6, 8, 10Scaled 3-4-5, more accurate

The deeper context most people miss

These are the integer solutions, and they matter practically because a builder can construct an exact right angle using only a tape measure. Larger multiples give better accuracy over longer distances, since a fixed measurement error is proportionally smaller across a bigger triangle.

Why the converse is the useful half

The theorem states that a right triangle satisfies the relation, and the converse states that a triangle satisfying it must be right-angled. The converse is what construction relies on: measuring three lengths and finding they satisfy the relation proves the angle is exactly 90 degrees, without any protractor or square. Euclid proved both directions, and the converse proof is less familiar and equally necessary, since a relation holding in one direction does not automatically hold in the other. The practical technique follows directly: mark 3 units along one edge and 4 along the other, then adjust until the diagonal measures exactly 5. Builders use this to square foundations, walls, and decks, and larger multiples improve precision. The theorem also generalises usefully through the law of cosines, which adds a correction term involving the cosine of the included angle and reduces to Pythagoras when that angle is 90 degrees since its cosine is zero. That generalisation means Pythagoras is a special case of a more general relationship rather than an isolated result, and the law of cosines handles any triangle. In non-Euclidean geometry the relation fails entirely: on a sphere, the sides of a right triangle do not satisfy it, which is why long-distance navigation requires spherical trigonometry and why the theorem is equivalent to the parallel postulate.

A worked example: distance in any number of dimensions

Sides of 3 and 4 giving 5 is the same calculation as finding the distance between two points in a plane, since the horizontal and vertical separations form the two legs of a right triangle. That equivalence makes the theorem the definition of distance in coordinate geometry, and it extends directly to three dimensions by applying it twice, and to any number of dimensions by summing all the squared differences. This Euclidean distance is the default metric throughout mathematics, physics, and machine learning, where it measures similarity between feature vectors. Alternatives exist and are used deliberately: Manhattan distance sums absolute differences rather than squares and suits grid-constrained movement and some optimisation problems, Chebyshev distance takes the maximum single difference, and these belong to a family parameterised by an exponent with Euclidean being the case of two. The choice matters in practice, since clustering and nearest-neighbour results differ between metrics. In high dimensions all of them suffer from concentration, where distances between random points become nearly equal and the metric stops discriminating, which is one facet of the curse of dimensionality and is why cosine similarity is frequently preferred for high-dimensional embeddings. The theorem also gives vector magnitude, which is why the length of a vector is the square root of the sum of its squared components.

Deciding where the relation applies

The theorem appears throughout practical measurement. Diagonal bracing length in construction follows directly, as does rafter length from run and rise, which is why roof framing uses it constantly. Squaring a layout uses the converse. Screen dimensions relate diagonal to width and height through it combined with the aspect ratio, which is how a 16:9 screen's actual width and height are derived from its advertised diagonal, and it explains why a 55-inch 16:9 screen has less area than a 55-inch 4:3 one would. Cable and pipe runs across a diagonal. Navigation for short distances where the Earth's curvature is negligible. Impedance in alternating current circuits combines resistance and reactance as perpendicular components, so total impedance is their Pythagorean sum, which is why the phasor representation works. Vector addition of perpendicular forces or velocities. Standard deviation of independent quantities combines the same way, so uncertainties add in quadrature rather than linearly, which is why combining several independent error sources gives a total smaller than their sum. That last application is easy to miss and is worth knowing: independent uncertainties of 3 and 4 units combine to 5, not 7.

Irrational numbers and the crisis Pythagoras caused

Applying the theorem to a unit square gives a diagonal of the square root of two, and the Pythagoreans discovered that this quantity cannot be expressed as a ratio of whole numbers. The proof is short: assume it can, in lowest terms, and derive that both numerator and denominator must be even, contradicting the assumption of lowest terms. This was catastrophic for a school whose philosophy held that all things are number, meaning whole number ratios, and the story that the discoverer was drowned at sea is almost certainly legend while the intellectual crisis was real. The consequence was a fundamental problem: geometric magnitudes existed that arithmetic could not express, which pushed Greek mathematics toward geometry as the more secure foundation and delayed the development of algebra for centuries. Eudoxus developed a theory of proportion handling incommensurable magnitudes, which is remarkably close to the modern construction of real numbers by Dedekind cuts two thousand years later. The full resolution required accepting irrational numbers as numbers, which took until the nineteenth century to formalise rigorously. It is a good illustration of how a simple geometric result can force a foundational reckoning, and of how mathematics has repeatedly progressed by accepting objects that initially appeared illegitimate.

Variations: generalisations and related results

The law of cosines extends the relation to any triangle by adding a term involving the cosine of the included angle. Pythagorean triples are the integer solutions, with Euclid's formula generating all primitive ones from pairs of coprime integers. Fermat's Last Theorem states that no analogous integer solutions exist for cubes or higher powers, which resisted proof for 358 years until Wiles completed it in 1994 using machinery from elliptic curves that had no existence when the problem was posed. The theorem generalises to higher dimensions as the distance formula, and to inner product spaces where the Pythagorean identity holds for orthogonal vectors, which is why orthogonal decomposition preserves squared magnitudes and why variance decomposes additively for independent variables. In statistics, the same structure appears in the decomposition of sums of squares in analysis of variance. In non-Euclidean geometries the relation fails, with spherical and hyperbolic versions taking different forms, and the fact that Pythagoras is equivalent to the parallel postulate connects it directly to the foundations of geometry. Generalisations to shapes other than squares on the sides also hold, since the relation is about areas of similar figures rather than squares specifically.

Using the Pythagorean theorem

Confirm the triangle has a right angle before applying it, since the relation holds only for right triangles and the law of cosines handles the general case. Use the converse to construct or verify a right angle with only a tape measure, marking 3 and 4 units and adjusting until the diagonal reads exactly 5. Use the largest multiple that fits when squaring a layout, since a fixed measurement error is proportionally smaller across a bigger triangle. Apply the same relation for distance between coordinates, extending to three dimensions by including the third squared difference. Combine independent uncertainties in quadrature rather than by addition, so errors of 3 and 4 units give 5 rather than 7. Recognise it in impedance, vector addition, and any situation combining perpendicular components. Use spherical trigonometry rather than Pythagoras for long-distance navigation, since the relation fails on a curved surface. And note that Euclidean distance loses discriminating power in high dimensions, where cosine similarity is frequently the better choice.

What people get wrong

  • Applying the relation to a triangle without a right angle, when the law of cosines is required and adds a term involving the cosine of the included angle.
  • Adding independent uncertainties directly, when they combine in quadrature so errors of 3 and 4 units give a total of 5 rather than 7.
  • Using a small 3-4-5 triangle to square a large layout, when a fixed measurement error is proportionally larger on a small triangle and a bigger multiple is more accurate.
  • Using Euclidean distance over long distances on the Earth's surface, where the relation fails on a curved surface and spherical trigonometry is required.

Where the math comes from

For a right triangle, a² + b² = c², where c is the hypotenuse opposite the right angle. The converse also holds: a triangle whose sides satisfy the relation must contain a right angle, which is what makes the 3-4-5 construction valid. The law of cosines generalises it to any triangle by adding a term in the cosine of the included angle.

Questions and answers

Diameter vs radius?

Diameter is the distance across; radius is half of diameter. Different formulas use different ones - read carefully which the calculator expects.

How precise should I use pi?

For everyday problems, 3.14 is fine. For engineering, use pi = 3.14159 or more decimal places. The calculator typically uses many decimal places internally.

Why do my measurements not match the formula?

Real objects have manufacturing tolerances, irregular shapes, and measurement error. Treat geometric calculations as ideals; physical reality often deviates 1-5%.

Surface area or volume?

Surface area is 2D (square units); volume is 3D (cubic units). Different formulas, different units. Mismatching is a common error.

How do I handle compound shapes?

Break into measurable simpler shapes (rectangles, triangles, circles), calculate each, and add. Subtract any holes or removed sections.

Does the theorem work for any triangle?

No, only right triangles. For any other triangle the law of cosines applies, which adds a term involving the cosine of the included angle and reduces to Pythagoras when that angle is 90 degrees since its cosine is zero.

How do builders use 3-4-5?

Through the converse: measuring 3 units along one line and 4 along the other, then adjusting until the diagonal reads exactly 5, guarantees a right angle. Larger multiples such as 6-8-10 give better accuracy over longer distances.

How does this relate to distance between points?

It's the same calculation. The horizontal and vertical separations form the legs of a right triangle and the distance is the hypotenuse. It extends to three dimensions by including the third squared difference, and to any number of dimensions similarly.

Why do uncertainties combine in quadrature?

Because independent uncertainties behave like perpendicular components, so they combine by the Pythagorean relation rather than by addition. Errors of 3 and 4 units give a combined uncertainty of 5, not 7, which is why several small independent errors matter less than expected.

What are Pythagorean triples?

Sets of three integers satisfying the relation, with 3-4-5 being the smallest. Euclid gave a formula generating all primitive triples from pairs of coprime integers, and their practical value is enabling exact right angles with only a measuring tape.

Why was the square root of two a crisis?

Because the Pythagoreans held that all quantities were ratios of whole numbers, and the diagonal of a unit square provably is not. The discovery pushed Greek mathematics toward geometry and delayed algebra, with full resolution requiring irrational numbers to be formalised in the nineteenth century.

Does the theorem hold on a sphere?

No. On a curved surface the relation fails, which is why long-distance navigation uses spherical trigonometry. The theorem is in fact equivalent to the parallel postulate, tying it directly to the foundations of Euclidean geometry.

Related calculators

Slope · Cylinder Volume · Circle · Trapezoid Area · Distance Formula 3D