Skip to content
100% local

Right triangle calculator

Solve a right triangle from any two known sides or angles.

Input

Right triangle calculator

Paste one or more right triangles, one per line, and this tool solves each one completely. Give any two known values — two legs (a=3 b=4), a leg and the hypotenuse (a=3 c=5), or a leg and an acute angle (a=5 A=30) — and it fills in the missing side, both acute angles, the perimeter, the area and the altitude from the right angle to the hypotenuse. The right angle is always the third one, opposite the hypotenuse, so you never enter it.

Options control how the answer is presented. Angle unit switches the two acute angles between degrees and radians. Decimal places rounds every number in the report, from 0 for whole-number answers up to 8 for closer precision. Check Pythagorean triple flags triangles whose three sides are all whole numbers, like the familiar 3-4-5 and 5-12-13. Show formulas used appends the identities behind the solution, such as c = √(a² + b²) or A = atan(a / b), so you can follow the working. Output format switches between a text report and a compact table for solving a whole batch at once.

Every line is solved on its own, so a typo on one line never hides the answers for the rest — the tool reports what went wrong on that line and keeps going. A line needs exactly two known values: two angles alone are rejected, since they fix the triangle's shape but not its size, and a leg longer than or equal to the given hypotenuse is rejected as geometrically impossible.

Everything runs locally in your browser — the numbers you enter are never uploaded anywhere. Copy the report, download it as a .txt file, or send the output back into the input to keep refining a batch of measurements.

FAQ

Which two values can I give it?
Any two of: the two legs (a, b), a leg and the hypotenuse (c), or a leg and one of the two acute angles (A or B). Two angles alone are not enough — they describe the shape but not the size, so at least one side is required.
How do I enter more than one triangle?
Put one triangle per line, each as space-separated key=value pairs, for example "a=3 b=4" on one line and "c=13 A=22.62" on the next. Every line is solved independently.
What counts as a Pythagorean triple?
A triangle whose three sides are all whole numbers, such as 3-4-5 or 5-12-13. Turn on "Check Pythagorean triple" to flag these automatically.
What is the "height to hypotenuse"?
The length of the perpendicular dropped from the right angle down to the hypotenuse — a different line from either leg, equal to a·b / c.
Is my data uploaded anywhere?
No. Every calculation runs entirely in your browser using JavaScript — nothing you type is sent to a server.