Connect via MCP →

Enter Calculation

Use consistent units: if the perimeter is in centimeters, the area must be in square centimeters. The sides are returned in the same length unit.

Formula

Advertisement

Results

Hypotenuse (c)
Right triangle with perimeter and area
Sides
Shorter leg (a)
Longer leg (b)
Hypotenuse (c)
Sum of the legs (a + b)
Angles
Angle opposite the shorter leg °
Angle opposite the longer leg °
Right angle 90°
Check
Perimeter (a + b + c)
Area (a × b / 2)

What this calculator does

This calculator recovers all three sides of a right triangle when the only things you know are its perimeter P (the total length around the triangle) and its area A. It returns the two legs a and b (the sides that form the right angle) and the hypotenuse c, together with the two acute angles. The solution is exact and closed-form — no guessing or iteration — and the calculator first checks whether a right triangle with your perimeter and area can exist at all. If it cannot, it tells you so and shows the largest area a right triangle with that perimeter could have.

How to use it

  1. Enter the perimeter P of the right triangle (a positive number).
  2. Enter the area A of the right triangle (a positive number).
  3. Press Calculate. You get the shorter leg a, the longer leg b, the hypotenuse c, and the two acute angles, plus a check row confirming that the sides reproduce your perimeter and area.

Use consistent units: if the perimeter is in centimeters, the area must be in square centimeters, and the sides come back in centimeters. The calculator itself is unit-agnostic.

The formula explained

A right triangle with legs a, b and hypotenuse c satisfies three conditions at once — the perimeter, the area, and the Pythagorean theorem:

$$a + b + c = P, \qquad \tfrac{1}{2}\,ab = A, \qquad a^2 + b^2 = c^2$$

Squaring the sum of the legs and using the Pythagorean theorem gives:

$$(a+b)^2 = a^2 + b^2 + 2ab = c^2 + 4A$$

Since a + b = P − c, substituting and expanding cancels the c² term:

$$(P - c)^2 = c^2 + 4A \;\;\Rightarrow\;\; P^2 - 2Pc = 4A \;\;\Rightarrow\;\; c = \frac{P^2 - 4A}{2P}$$

The sum of the legs follows immediately:

$$a + b = P - c = \frac{P^2 + 4A}{2P}$$

Knowing the sum a + b and the product ab = 2A, Vieta's formulas say the two legs are the roots of a quadratic:

$$t^2 - (a+b)\,t + 2A = 0 \quad\Rightarrow\quad a,\,b = \frac{(a+b) \pm \sqrt{(a+b)^2 - 8A}}{2}$$

A solution exists only when the hypotenuse is positive and the discriminant is non-negative. Both conditions combine into a single bound on the area:

$$A \le \frac{P^2}{12 + 8\sqrt{2}} \approx 0.0429\,P^2$$

with equality exactly for the isosceles right triangle (a = b). If your area exceeds this bound, no right triangle with that perimeter exists and the calculator explains why instead of returning meaningless numbers.

Advertisement

Worked example

Suppose the perimeter is P = 30 and the area is A = 30.

  1. Sum of the legs: a + b = (P² + 4A) / (2P) = (900 + 120) / 60 = 1020 / 60 = 17.
  2. Hypotenuse: c = P − (a + b) = 30 − 17 = 13.
  3. Discriminant: D = (a + b)² − 8A = 289 − 240 = 49, so √D = 7.
  4. Legs: t = (17 ± 7) / 2, giving b = 12 and a = 5.

Check: 5 + 12 + 13 = 30 matches the perimeter, (5 × 12) / 2 = 30 matches the area, and 5² + 12² = 25 + 144 = 169 = 13² confirms the right angle. This is the classic 5–12–13 right triangle.

Frequently asked questions

Why does the calculator say no such right triangle exists? For a fixed perimeter P, the area of a right triangle cannot exceed P² / (12 + 8√2) ≈ 0.0429 P², the value reached by the isosceles right triangle. If your area is above that bound, no side lengths can satisfy the perimeter, the area, and the Pythagorean theorem at the same time, so the calculator reports the triangle as impossible and shows the maximum feasible area.

Are there ever two different triangles with the same perimeter and area? No — for a right triangle the solution is unique. The two roots of the quadratic are the two legs of the same triangle, so swapping them only relabels a and b. The calculator always reports the shorter leg as a and the longer leg as b.

Do the perimeter and area need to be in matching units? Yes. Enter the perimeter in a length unit and the area in the square of that same unit — for example meters and square meters. The three sides are then returned in that length unit.

Last updated: