Perimeter Of A Right Triangle - Two-Leg or Leg-and-Hypotenuse Solver

Use this perimeter of a right triangle calculator to add the two legs and the hypotenuse with the Pythagorean theorem, with step math and the two acute angles.

Updated: June 18, 2026 • Free Tool

Perimeter Of A Right Triangle Calculator

Pick how the sides are given. Two-legs mode takes a and b and computes c with the Pythagorean theorem. Leg-and-hypotenuse mode takes b and c and recovers the missing leg.

Length of leg a (one of the two sides that form the right angle). Required in two-legs mode; recovered automatically in leg-and-hypotenuse mode.

Length of leg b (the other side that forms the right angle). Always required.

Length of the hypotenuse (the side opposite the right angle). Required only in leg-and-hypotenuse mode; left at default in two-legs mode.

Results

Perimeter
0units
Hypotenuse (c) 0units
Leg a 0units
Leg b 0units
Area 0units²
Angle at A 0°
Angle at B 0°

What Is the Perimeter of a Right Triangle?

A perimeter of a right triangle calculator sums the three sides of a right triangle using the Pythagorean theorem, so a single page returns the perimeter, the hypotenuse, the area, and the two acute angles once the inputs are entered.

  • Geometry homework: Confirm the perimeter of a 3-4-5 or other right triangle problem.
  • Trim and baseboard cutting: Add up the three edges of a right-angle frame, including the diagonal, before cutting molding or edging.
  • Roof and stair stringer length: Total the run, the rise, and the diagonal rafter or stringer to estimate linear feet of material.
  • Planter or right-angle fence edges: Compute the total linear feet of edging when one corner is a right angle and the diagonal closes the shape.

The page is intentionally narrow: the perimeter of a right triangle is the case where the right angle is known and the three sides are summed. If you only need the longest side itself, the hypotenuse calculator in the same category returns just c.

If you only need the longest side itself instead of the full perimeter, the Hypotenuse Calculator page returns just c from the two legs using the same Pythagorean theorem.

How the Perimeter of a Right Triangle Calculator Works

The page implements the Pythagorean theorem and the definition of perimeter in two ways. In two-legs mode it squares the two legs, takes the square root of the sum to get c, then adds a, b, and c. In leg-and-hypotenuse mode it squares the hypotenuse, subtracts the square of the known leg, and takes the square root to recover the missing leg before adding all three sides.

P = a + b + sqrt(a^2 + b^2)
  • a: Length of leg a, one of the two sides that meet at the right angle.
  • b: Length of leg b, the other side that meets at the right angle.
  • c: Length of the hypotenuse, the side opposite the right angle. Equal to sqrt(a^2 + b^2) in two-legs mode, or supplied as input in leg-and-hypotenuse mode.
  • sqrt(a^2 + b^2): Principal (non-negative) square root of the sum of the squared legs. Equal to the hypotenuse.
  • P: Perimeter of the right triangle, the sum a + b + c.

The two acute angles come from arctan of the opposite leg divided by the adjacent leg. Angle at the end of leg a is arctan(b / a) and angle at the end of leg b is arctan(a / b); together they sum to 90 degrees for any valid right triangle.

Worked example: the 3-4-5 right triangle

Mode: Two legs. Leg a = 3, Leg b = 4.

c = sqrt(a^2 + b^2) = sqrt(9 + 16) = sqrt(25) = 5. P = a + b + c = 3 + 4 + 5 = 12.

Perimeter P = 12 units. Hypotenuse c = 5 units, area = 6 units², angle A = 53.13°, angle B = 36.87°.

The result is a clean integer because (3, 4, 5) is a Pythagorean triple.

According to Wikipedia, in a right triangle the side opposite the right angle is the hypotenuse and satisfies c^2 = a^2 + b^2, so the perimeter is the sum of all three sides, P = a + b + sqrt(a^2 + b^2).

If the inputs include an angle or one of the sides is missing without the hypotenuse, the Right Triangle Calculator page solves the same right triangle from any two values using the Pythagorean theorem plus sine, cosine, and tangent.

Key Concepts Behind the Perimeter Formula

Four ideas explain why the perimeter of a right triangle is what it is and how the formula behaves when the legs change.

Right triangle

A triangle with exactly one 90 degree angle. The two sides forming that right angle are the legs, and the third side, opposite the right angle, is the hypotenuse.

Perimeter

The total distance around a closed shape, found by adding the lengths of every side. For any triangle, perimeter equals the sum of all three side lengths.

Pythagorean theorem

In any right triangle, c squared equals a squared plus b squared. The theorem gives a clean way to recover c from a and b, or to recover one leg from c and the other leg.

Pythagorean triple

A set of three positive integers (a, b, c) that satisfy c^2 = a^2 + b^2. The smallest is 3-4-5; others include 5-12-13, 8-15-17, and 7-24-25, plus any multiple of those.

If you need to find the perimeter of a triangle that is not right-angled, the underlying arithmetic is the same (add the three sides), but the missing side has to come from the law of sines or cosines instead of the Pythagorean theorem.

When the triangle is not right-angled, the same perimeter arithmetic applies but the missing side has to come from the law of sines or cosines, and the Triangle Perimeter Calculator page handles that broader case.

How to Use This Perimeter of a Right Triangle Calculator

Five short steps cover both modes, from the classic 3-4-5 textbook case to a leg-and-hypotenuse problem where one leg has to be recovered.

  1. 1 Pick the solve-for mode: Choose Two legs to find the perimeter from a and b, or Leg and hypotenuse to recover the missing leg from b and c.
  2. 2 Enter the leg lengths: Type the lengths of the two legs in any same unit. The defaults of 3 and 4 form the 3-4-5 right triangle.
  3. 3 Enter the hypotenuse in leg-and-hypotenuse mode: In leg-and-hypotenuse mode, type the length of c. Leave this field at its default in two-legs mode.
  4. 4 Read the perimeter and the supporting values: The primary output is P (the perimeter). The panel also shows the hypotenuse, both legs, the area, and the two acute angles.
  5. 5 Reset or change units if needed: Click Reset to return to the 3-4-5 example. Use the Distance Converter to change the unit of the answer.

Try the 5-12-13 triple: enter a = 5 and b = 12 in two-legs mode. The calculator returns perimeter = 30, hypotenuse = 13, area = 30, angle A = 67.38°, and angle B = 22.62°. Switch to leg-and-hypotenuse mode and enter c = 13, b = 5 to recover a = 12 and the same perimeter of 30.

The 3-4-5 and 5-12-13 examples are Pythagorean triples, and the Pythagorean Triples Calculator page generates and verifies every integer triple up to a chosen limit so you can spot the clean answers in any problem.

Benefits of Using This Perimeter of a Right Triangle Calculator

These benefits matter most when you are solving a problem by hand and want a quick, trustworthy check that the three sides are being added correctly.

  • Skip the arithmetic mistakes: Squaring two numbers, taking the square root, then adding three values is the most error-prone step. The calculator handles those steps and reports the result to four decimals.
  • Switch between two modes: Most homework problems give two legs and ask for the perimeter; some give c and one leg. The same page handles both.
  • See the full triangle at once: The hypotenuse, both legs, the area, and the two acute angles come back with the perimeter, so a follow-up question does not need a second calculator.
  • Handle any unit consistently: The result is in the same unit as the inputs, so the page works in centimeters, meters, feet, inches, or pixels.
  • Connect to the rest of geometry: If the next step is the integer triple behind a clean answer, the peer calculators in the same category are linked from each section.

The page is most useful as a check, not as a replacement for understanding the formula. Use it to confirm a homework answer, to verify a rafter or diagonal measurement on the job, or to recover a missing leg in a design problem where the hypotenuse was the easier number to measure.

The area that comes back in the results panel uses (a x b) / 2, and the Triangle Area Calculator page handles the same area calculation for non-right triangles where the base and height are not the two legs.

Factors That Affect the Perimeter Result

The Pythagorean theorem and the sum-of-sides definition are the same in every case, but a few factors change how the result should be read and what counts as a valid input.

Which leg is which

The perimeter only depends on a + b + sqrt(a^2 + b^2), so swapping a and b leaves P, the hypotenuse, and the area unchanged. The two acute angles swap, because angle A depends on the leg at the end of vertex A.

Unit of the inputs

The result is in the same unit as the legs. If a and b are in centimeters, P is in centimeters. Use the Distance Converter to change the unit to meters, feet, inches, or pixels.

Isosceles right triangle (a = b)

When the two legs are equal, c = a * sqrt(2) and P = 2a + a*sqrt(2). Both acute angles are 45 degrees, which is a quick check that the two legs really are equal.

Leg-and-hypotenuse mode and the longest side

In leg-and-hypotenuse mode the calculator rejects c values that are not strictly greater than the known leg. The hypotenuse is, by definition, the longest side, so a c that is shorter than the other leg means the inputs are inconsistent.

  • The formula is exact only for right triangles. For a non-right triangle, the missing side has to come from the law of sines or cosines before the three sides can be added; use the general triangle perimeter solver in the same category.
  • The calculator uses the principal (non-negative) square root, so a negative leg is treated as an invalid input rather than producing a complex number. Lengths in real geometry are always non-negative.
  • Decimal precision is limited to four displayed digits. For engineering work that needs more decimals, run the formula directly with a tool that supports higher precision.

According to Wolfram MathWorld, the sides of a right triangle satisfy the Pythagorean theorem c^2 = a^2 + b^2, so the perimeter of the right triangle equals a + b + c.

According to Khan Academy, the Pythagorean theorem lets you recover either the hypotenuse from the two legs or one leg from the hypotenuse and the other leg, and the perimeter is the sum a + b + c once all three sides are known.

If the two legs follow a special pattern such as 1-sqrt(2)-2 or 1-sqrt(3)-2, the Special Right Triangles Calculator page returns the perimeter and the angles for those fixed ratios without re-entering the Pythagorean theorem.

Perimeter of a right triangle calculator showing legs a and b, the hypotenuse c, and the perimeter formula a + b + sqrt(a^2 + b^2) with step math
Perimeter of a right triangle calculator showing legs a and b, the hypotenuse c, and the perimeter formula a + b + sqrt(a^2 + b^2) with step math

Frequently Asked Questions

Q: What is the formula for the perimeter of a right triangle?

A: The formula is P = a + b + sqrt(a^2 + b^2). Square the two legs a and b, add the squares, take the square root of the sum to get the hypotenuse c, then add a, b, and c. In leg-and-hypotenuse mode, recover the missing leg with sqrt(c^2 - b^2) first.

Q: How do I find the perimeter of a right triangle with two legs?

A: Type the two legs (a and b) into the calculator in any same unit, leave the Solve for selector on Two legs, and read the result P. The page also returns the hypotenuse, the area, and the two acute angles for the same triangle.

Q: Can I find the perimeter with one leg and the hypotenuse?

A: Yes. Switch the Solve for selector to Leg and hypotenuse, type the hypotenuse c and the known leg, and the calculator recovers the missing leg with sqrt(c^2 - b^2). It then returns the perimeter, the hypotenuse, the area, and the acute angles for the same triangle.

Q: What is the perimeter of a 3-4-5 right triangle?

A: The 3-4-5 right triangle is a Pythagorean triple with c = 5. The perimeter is 3 + 4 + 5 = 12, the area is 6, and the two acute angles are about 53.13 degrees and 36.87 degrees. Use the Reset button on the calculator to load this case.

Q: What units does the perimeter of a right triangle calculator use?

A: The calculator is unit-agnostic: it returns the perimeter in the same unit as the legs. If the legs are in centimeters the perimeter is in centimeters; if the legs are in feet the perimeter is in feet. Use the Distance Converter in the same category to change the unit of the answer.

Q: Is the perimeter of a right triangle always longer than the hypotenuse?

A: Yes. The perimeter is the sum of all three sides, so it is the hypotenuse plus the two legs, which are both positive. The perimeter is therefore always greater than the hypotenuse alone, and the calculator returns both values side by side so you can confirm that.