Home › Math › Pythagorean Theorem Calculator
Pythagorean Theorem Calculator
Finds the missing side of a right triangle from any two of the legs a, b and hypotenuse c using a² + b² = c², and reports the area, perimeter and acute angles.
When to use
You know two sides of a right triangle and need the third, or want to check whether three lengths form a right triangle.
Do not use when: The triangle is not right-angled (use triangle-solver) or you need the distance between coordinates (use distance-2d).
Formula
c = √(a² + b²); a = √(c² − b²); b = √(c² − a²); area = a·b/2; angle_a = atan(a/b), angle_b = atan(b/a)
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
a | number | no | First leg (a side adjacent to the right angle). Give any two of a, b, c. Range: > 0 | |
b | number | no | Second leg. Range: > 0 | |
c | number | no | Hypotenuse (the longest side, opposite the right angle). Range: > 0 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
side_a | number | Length of leg a. | |
side_b | number | Length of leg b. | |
hypotenuse_c | number | Length of the hypotenuse. | |
solved_for | string | Which side was computed ('a', 'b' or 'c'), or a note that all three were given and consistent. | |
area | number | a × b / 2. | |
perimeter | number | a + b + c. | |
angle_a_degrees | number | ° | atan(a / b) in degrees. |
angle_b_degrees | number | ° | atan(b / a) in degrees; the two acute angles sum to 90°. |
Example
a = 3, b = 4: {"a":3,"b":4} → {"side_a":3,"side_b":4,"hypotenuse_c":5,"solved_for":"c","area":6,"perimeter":12,"angle_a_degrees":36.8699,"angle_b_degrees":53.1301}
a = 5, c = 13: {"a":5,"c":13} → {"side_b":12,"solved_for":"b","area":30,"perimeter":30,"angle_a_degrees":22.6199}
GET https://tttkmbb.com/api/v1/calculate/pythagorean?a=3&b=4
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/pythagorean(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/pythagorean · Markdown: https://tttkmbb.com/math/pythagorean.md · JSON definition: https://tttkmbb.com/math/pythagorean.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="pythagorean" - OpenAPI operationId:
solve_pythagorean_theorem - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Pythagorean theorem (reference)
- Wolfram MathWorld – Pythagorean Theorem (reference)
FAQ
What if I enter all three sides?
They are checked against a² + b² = c². Consistent values are returned unchanged; otherwise an error reports the hypotenuse the two legs imply.
Why must the hypotenuse be the longest side?
Since c² = a² + b², c is always longer than either leg. A leg equal to or longer than c gives a negative square and no real triangle.
Related calculators
- Right Triangle Calculator — Solve a right triangle from sides and angles.
- Distance Between Two Points Calculator — Distance between points uses the same theorem.
- Triangle Solver — General triangles (law of sines and cosines).