AI Tools Free

Triangle Perimeter Calculator

Enter First side (a), Second side (b), and Third side (c) into this triangle perimeter calculator and perimeter of a triangle calculator to sum P = a + b + c after verifying the strict triangle inequality (a + b > c). Test the preloaded 3-4-5 right triangle returning 12, or check equilateral, isosceles, and scalene framing spans up to 12 significant digits in your browser.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Calculate.

Allowed range: 1e-09 to 1,000,000,000.

Allowed range: 1e-09 to 1,000,000,000.

Allowed range: 1e-09 to 1,000,000,000.

Your result
Enter your details

Result will appear here

How to Calculate the Perimeter of a Triangle & Strict Inequality Rule

Learning how to calculate the perimeter of a triangle requires two steps: first confirming that the three line segments can actually close into a nondegenerate two-dimensional triangle, and second summing their lengths. By the Euclidean strict triangle inequality (see our Triangle Inequality Checker), the sum of the two shorter sides must strictly exceed the longest side.

P = a + b + c, s = P / 2 = (a + b + c) / 2 (where max(a, b, c) < (a + b + c) / 2)

In batch11-core.js, the triangle() helper sorts your three inputs in descending order x ≥ y ≥ z and tests z <= x − y (a rearrangement that prevents floating-point overflow near 1e9) along with Kahan's factored Heron area formula before returning P = a + b + c. Invalid inputs return "Sides must satisfy the strict triangle inequality."

Diagram of a 3-4-5 right triangle showing side lengths a = 3, b = 4, and hypotenuse c = 5 summing to perimeter P = 12 and semiperimeter s = 6
Diagram of a 3-4-5 right triangle showing side lengths a = 3, b = 4, and hypotenuse c = 5 summing to perimeter P = 12 and semiperimeter s = 6.

Perimeter of a Triangle Calculator & Benchmark Table

Compare 10 verified triangle configurations to see how this perimeter calculator triangle checks the strict triangle inequality (y + z > x), computes the semiperimeter s = P / 2, and outputs #result-main:

First Side (#a)Second Side (#b)Third Side (#c)Triangle ClassificationSemiperimeter (s = P / 2)Perimeter (#result-main)Inequality & Engineering Status
3 (preloaded)4 (preloaded)5 (preloaded)Pythagorean right (3² + 4² = 5²)612Valid (3 + 4 = 7 > 5; area = 6)
51213Pythagorean right (5² + 12² = 13²)1530Valid (5 + 12 = 17 > 13; area = 30)
81517Pythagorean right (8² + 15² = 17²)2040Valid (8 + 15 = 23 > 17; area = 60)
666Equilateral (a = b = c)918Valid (P = 3a = 18; area = 9√3 ≈ 15.59)
101012Isosceles gable truss (a = b)1632Valid (10 + 10 = 20 > 12; altitude h = 8)
789Acute scalene triangle1224Valid (7 + 8 = 15 > 9; area = 12√5 ≈ 26.83)
131415Heronian scalene triangle2142Valid (13 + 14 = 27 > 15; integer area = 84)
18.5 ft18.5 ft30 ftSymmetric roof rafter & tie beam33.5 ft67 ftValid (18.5 + 18.5 = 37 > 30)
347Degenerate collinear segmentsN/ARejectedFails strict inequality (3 + 4 = 7, area = 0)
2310Open unclosed segmentsN/ARejectedFails strict inequality (2 + 3 = 5 < 10)

How to Use the Perimeter of a Triangle Calculator Step by Step

Follow these three steps to run the perimeter of a triangle calculator in the workspace above.

Enter the First Side (#a)

Type the first side length a (1e-9 to 1,000,000,000) into First side (#a, preloaded with 3).

Input and settings
First side (#a = 3), Second side (#b = 4), and Third side (#c = 5) inputs in the Triangle Perimeter Calculator
First side (#a = 3), Second side (#b = 4), and Third side (#c = 5) inputs in the Triangle Perimeter Calculator.

Enter Remaining Two Sides (#b, #c)

Enter the remaining two side lengths into Second side (#b, preloaded with 4) and Third side (#c, preloaded with 5) using the same length unit.

Tool result
Strict triangle inequality validation checking z > x − y before computing P = a + b + c
Strict triangle inequality validation checking z > x − y before computing P = a + b + c.

Click Calculate and Save the Perimeter

Click Calculate to output the 12-significant-digit perimeter in #result-main, then copy the result or convert units with our Length Converter.

Review the details
Result panel displaying 12 linear units for preloaded sides a = 3, b = 4, and c = 5
Result panel displaying 12 linear units for preloaded sides a = 3, b = 4, and c = 5.

Worked Examples: Perimeter of Triangle Calculator

These three worked examples show how the perimeter of triangle calculator evaluates the preloaded 3-4-5 layout triangle, a timber roof truss, and an invalid collinear input.

Preloaded 3-4-5 Right Triangle (a = 3, b = 4, c = 5)

Carpenters and masons use a 3-4-5 triangle to square 90° corners. With First side = 3, Second side = 4, and Third side = 5, the two shorter sides sum to 3 + 4 = 7 > 5, passing the strict triangle inequality and returning a perimeter of 12 units.

3-4-5 carpenter's layout triangle with legs 3 and 4 and diagonal 5 yielding total perimeter P = 12
3-4-5 carpenter's layout triangle with legs 3 and 4 and diagonal 5 yielding total perimeter P = 12.

Isosceles Gable Roof Truss (a = 18.5 ft, b = 18.5 ft, c = 30 ft)

A symmetric timber roof truss has two sloped upper rafters of 18.5 ft each and a horizontal bottom tie beam of 30 ft. Because 18.5 + 18.5 = 37 > 30, entering 18.5, 18.5, and 30 outputs 67 feet of outer framing lumber per truss.

Symmetric gable roof truss with two 18.5 ft rafters and a 30 ft bottom chord totaling 67 ft perimeter
Symmetric gable roof truss with two 18.5 ft rafters and a 30 ft bottom chord totaling 67 ft perimeter.

Rejected Collinear Boundary Case (a = 3, b = 4, c = 7)

If a user enters First side = 3, Second side = 4, and Third side = 7, the two shorter segments lie flat along the third segment (3 + 4 = 7, enclosed area = 0). The solver halts and outputs "Sides must satisfy the strict triangle inequality."

Collinear segments of lengths 3 and 4 lying flat on a segment of length 7 with zero enclosed area
Collinear segments of lengths 3 and 4 lying flat on a segment of length 7 with zero enclosed area.

How to Calculate the Perimeter of a Right Triangle, Isosceles & SAS

When your problem provides fewer than three explicit side lengths, find the missing side first and then enter all three sides above:

How to Calculate the Perimeter of a Right Triangle From Two Legs (a, b): If you know the two perpendicular legs a and b of a right triangle, compute the hypotenuse c = √(a² + b²) with our Pythagorean Theorem Calculator. The total perimeter is P = a + b + √(a² + b²). If you instead know the hypotenuse c and one leg a, the other leg is b = √(c² − a²).

Equilateral, Isosceles, and SAS Triangles: For an equilateral triangle with side length a, enter a into all three fields (P = 3a). For an isosceles triangle with two equal legs a and base b (where 2a > b), enter a, a, b (P = 2a + b). When two sides a and b and their included angle γ are known, use our Triangle Side Calculator to evaluate the Law of Cosines c = √(a² + b² − 2ab cos γ), then sum P = a + b + c.

Formulas for right triangle perimeter P = a + b + √(a² + b²), isosceles perimeter P = 2a + b, and equilateral perimeter P = 3a
Formulas for right triangle perimeter P = a + b + √(a² + b²), isosceles perimeter P = 2a + b, and equilateral perimeter P = 3a.

Common Triangle Perimeter Mistakes & Related Geometry Tools

Watch out for these three common mistakes when calculating triangle perimeter:

Three arbitrary positive numbers do not automatically form a triangle: always verify that the longest side is strictly less than the sum of the other two sides. Also note that given only a general scalene triangle's base b and altitude h (see our Triangle Height Calculator), the area A = (1/2)bh is fixed, but the perimeter is not uniquely determined unless you also know whether the triangle is right or isosceles.

Chain your triangle calculations with our Heron's Formula Calculator or Similar Triangles Calculator linked below.

Comparison of two triangles sharing the same base b and height h (equal area) but having different side lengths and perimeters
Comparison of two triangles sharing the same base b and height h (equal area) but having different side lengths and perimeters.

Frequently Asked Questions About the Triangle Perimeter Calculator

Answers about using Triangle Perimeter Calculator and understanding its results.

What is the formula for the perimeter of a triangle?

Add the lengths of all three sides using the same measurement unit: P = a + b + c, provided the sides satisfy the strict triangle inequality (a + b > c, a + c > b, and b + c > a). For a = 3, b = 4, c = 5, P = 3 + 4 + 5 = 12.

How do I calculate the perimeter of a right triangle with two sides?

When the two perpendicular legs a and b are given, compute the hypotenuse c = √(a² + b²) via the Pythagorean theorem and sum P = a + b + √(a² + b²). When the diagonal hypotenuse c and one leg a are given, substitute √(c² − a²) for the unknown leg.

How do I find the perimeter of an isosceles or equilateral triangle?

Triple the side length for an equilateral shape (P = 3a), or double the repeated leg length and add the base span for an isosceles shape (P = 2a + b, subject to 2a > b).

Why does the calculator say "Sides must satisfy the strict triangle inequality"?

Three line segments can close into a nondegenerate triangle if and only if the two shorter sides add up to strictly more than the longest side (y + z > x). If y + z ≤ x, the segments either cannot touch or collapse into a flat line of zero area.

What is the semiperimeter of a triangle and how is it used?

The semiperimeter s is half of the triangle's perimeter: s = P / 2 = (a + b + c) / 2. It is the primary input for Heron's area formula A = √(s(s − a)(s − b)(s − c)) and the inscribed circle radius formula r = A / s.

Calculate with your input

Choose another tool for your next calculation, conversion, or text task.

Calculate