Skip to content
Pythagorean Theorem Calculator

Pythagorean theorem calculator

Find a missing side with the Pythagorean theorem calculator, or check three known lengths.

a² + b² = c²
  1. Choose a side, or keep Auto.
  2. Enter two known lengths; leave the unknown side blank.
  3. Calculate to see the answer and steps.

a and b meet at 90°. c is opposite that corner. Enter all three lengths to check them.

Choose the result unit here. Use “No unit” for every length if no unit is given.

Decimal places

Enter positive numbers, such as 3.5, 1e3 or √2.

Try an example

Enter two known sides to begin.

Red marks the calculated side. The corner marker is 90°.

Try 3 and 4 to get a hypotenuse of 5, or enter your own lengths.

Comparison history

Up to eight comparisons stay in this browser. Nothing is uploaded. Private browsing may prevent saving.

    Ctrl / ⌘ + Enter · Calculate Esc · ClearFor right triangles only; not a measurement or safety certificate.

    Pythagorean theorem calculator: which side is c?

    Before entering lengths in the Pythagorean theorem calculator, identify the right angle. I mark that corner before writing any numbers. The two sides touching it are the legs, a and b; the opposite side is the hypotenuse, c. The hypotenuse is the longest side of a right triangle. It stays c even when you rotate the drawing or turn the page upside down. A side is not the hypotenuse merely because it looks diagonal.

    Choose Auto and leave the unknown field empty, or select the exact side you want to calculate. In an explicit side mode the corresponding field is read-only and ignored; changing the mode does not erase your source values. With three filled fields, Auto checks the supplied lengths. It does not replace an inconvenient measurement with the answer the theorem would require. That distinction matters for both homework checking and rectangle diagonals.

    Add the squares to find the hypotenuse

    When both legs are known, c = √(a² + b²). For a rectangle 7.2 cm wide and 9.6 cm tall, the diagonal is √(7.2² + 9.6²) = √(51.84 + 92.16) = √144 = 12 cm. The square root returns a length; 144 is the square of that length, not the diagonal itself. Area is a separate result: 7.2 × 9.6 / 2 = 34.56 cm² for the right triangle.

    The teal and red squares connect this arithmetic to geometry. Each tile is a square built on one side, with a shared area scale. For the familiar 3–4–5 triangle, the two smaller square areas are 9 and 16, and the larger is 25. The triangle drawing highlights the calculated side. Very narrow triangles are widened for readable labels and explicitly marked schematic; they must not be measured from the screen.

    Squares with areas 9, 16 and 25 representing the sides of a 3–4–5 triangle
    9 + 16 = 25: the theorem adds square areas, then takes a length from the root.

    Subtract squares for a missing leg

    Knowing c changes the operation. With c = 13 and b = 12, solve a = √(c² − b²) = √(169 − 144) = √25 = 5. Subtract the squares before taking the root. The shortcut 13 − 12 = 1 gives the wrong length. A hypotenuse equal to or shorter than the known leg cannot produce a positive missing leg, so the tool rejects that input instead of displaying zero or an imaginary construction length.

    Angles α and β are the two acute angles. In the diagram, α is opposite a and β is opposite b. For a = 3 and b = 4, α = atan2(3, 4) ≈ 36.8699° and β ≈ 53.1301°. They add to 90°. The radians beside each angle express the same angle in another unit, not a different result. Height h is the perpendicular altitude onto c, calculated as a × b / c.

    Put every length on the same scale

    Choose a unit beside every known input, then choose the output unit. Millimetres, centimetres, metres, inches and feet are converted before solving. For a = 0.3 m and b = 40 cm, the common values are 0.3 m and 0.4 m. Therefore c = √(0.09 + 0.16) = 0.5 m. Entering 0.3 and 40 as unitless numbers describes a completely different triangle.

    Unitless mode suits textbook ratios and lengths with an unspecified shared unit. Do not mix a unitless input with a physical length. The output must also belong to the same category. Changing output units leaves the original input values untouched and recalculates the result. Linear results carry the chosen unit; area carries its square. A triangle with legs 6 in and 8 in has c = 10 in and area = 24 in², not 24 in.

    Three lengths are a check, not a missing-side problem

    The check mode first takes the largest supplied length as the candidate hypotenuse, regardless of the order of the boxes. It verifies that the lengths can form a nondegenerate triangle, then compares the squared legs with the squared longest side. For 3, 4 and 6, the normalized residual is 3²/6² + 4²/6² − 1 = −11/36, so the right-angle check fails. The entered 6 remains 6.

    The numerical threshold is 0.0000000001 on this normalized squared residual. It compensates for floating-point arithmetic; it is not a tolerance for a tape measure, an allowable construction error or a certificate that a corner is square. Rounded dimensions can fail even when the underlying ideal triangle is right. Conversely, passing the calculation does not prove how accurately those dimensions were measured. I keep that distinction beside the result rather than letting a green-looking answer imply more than it can establish.

    A three-side check cannot reliably classify extremely unequal lengths when the smaller squared ratio is at or below floating-point precision. The tool reports that limit instead of claiming a right angle. In a passing check, diagram labels are sorted: a is the shorter leg, b the longer leg and c the longest side; the input boxes keep their original order.

    Reference triangles and unit relationships

    Integer triples are useful control points, not the only valid right triangles. Scaling every side by the same factor preserves the angles and multiplies the area by the square of the factor. Doubling 3–4–5 gives 6–8–10: perimeter doubles from 12 to 24, while area increases from 6 to 24. Irrational roots are equally valid lengths; a triangle with two unit legs has hypotenuse √2.

    The OpenStax explanation of right triangles is a useful reference for the theorem and the geometry vocabulary. For diagonal measurements, first verify that the two input directions are perpendicular. The theorem does not turn an arbitrary triangle into a right one, and it does not replace the law of cosines when the included angle differs from 90°.

    Right-triangle reference values
    abcAreaPerimeter
    345612
    512133030
    815176040
    724258456
    11√20.52 + √2
    Exact length conversions
    RelationshipFactor
    1 m100 cm = 1,000 mm
    1 in0.0254 m
    1 ft12 in = 0.3048 m

    Keep the root until the final answer

    The tool uses unrounded numbers internally and rounds only the display. Decimals, 1e3 and √2 are accepted. Decimal places describe presentation, not the accuracy of your source measurements. Very small or large results use scientific notation so a positive length is not silently shown as zero.

    Exact form is shown only when both normalized known sides are integers and their squared sum or difference is an integer no greater than 100,000,000. A decimal result remains available for other inputs.

    The implementation uses a hypotenuse operation that avoids unnecessary overflow and scales missing-leg subtraction when c is close to the known leg. Inputs after conversion must lie between 1e−150 and 1e150. The tests include small values, unequal units, invalid lengths and all three solve directions. Copy includes the useful side and geometry results; the comparison history stores source inputs, so restoring a row runs the calculation again rather than reusing a rounded answer.

    Independent arithmetic control cases
    InputsExpected result
    a = 3, b = 4c = 5; h = 2.4
    b = 12, c = 13a = 5
    a = 0.3 m, b = 40 cmc = 0.5 m
    a = 1, b = 1c = √2 ≈ 1.4142
    3, 4, 6 (check)Not right; residual −11/36
    b = c = 5Rejected: no positive leg

    A diagonal is two perpendicular differences

    For coordinate points, use the differences in x and y as the legs. From (2, 1) to (8, 9), those changes are 6 and 8, so distance = √(6² + 8²) = 10. It is the straight-line distance, not the route that goes six units across and eight units up. OpenStax derives the distance formula from the same right-triangle relationship.

    For a worked decision process, read the missing-side guide. The triples and exact-roots guide separates patterns from rounding, while the rectangle-diagonal guide explains what a measurement comparison can and cannot show. Save up to eight comparisons locally or export their source values as CSV. Nothing is uploaded, and browser storage can be unavailable in private mode; export anything you need to keep beyond this browser.

    A six-unit horizontal and eight-unit vertical change joined by a ten-unit diagonal
    Coordinate differences become the perpendicular legs; distance is the hypotenuse.

    Guides

    Questions and answers

    Does it work for any triangle?

    No. Missing-side calculations assume a right angle between the legs. Three-side check mode can test the supplied lengths numerically.

    What if I enter all three sides?

    Auto switches to a consistency check. It never silently replaces your third input. The largest length is treated as the candidate hypotenuse.

    Can I mix inches and centimetres?

    Yes, if each known side has a physical unit and the output uses a physical unit too. All lengths are converted before calculation.

    Is the diagram always to scale?

    The legs are proportional for ordinary aspect ratios. Very narrow triangles are widened for readable labels and explicitly marked schematic.

    Why is no exact root shown?

    Exact form is shown only when both normalized known sides are integers and their squared sum or difference is an integer no greater than 100,000,000. A decimal result remains available for other inputs.

    Where is the comparison history saved?

    Up to eight comparisons are stored locally in this browser. Storage can be blocked; CSV exports provide a file of the source inputs.

    About this site