CCalclabhub

Math · 61 calculations

Geometry

How To Calculate The Perimeter Of A Triangle

The perimeter of a triangle is the total distance around its three edges, found by simply adding the three side lengths. This page also derives the related quantities that share those sides: the semi-perimeter, the area via Heron's formula and the longest of the three sides.

Last updated

Quick Answer

P = a + b + c

a
Length of the first side
b
Length of the second side
c
Length of the third side
P
Perimeter (a + b + c)
s
Semi-perimeter (P / 2)

Add the three side lengths to get the perimeter. Half of that total is the semi-perimeter, which feeds Heron's formula for the area, and the longest side is simply the largest of the three lengths. For a triangle with sides 3, 4 and 5 the perimeter is 12, the semi-perimeter is 6, the area is 6 and the longest side is 5.

What Is The Perimeter Of A Triangle?

The perimeter of a triangle is the total length around its boundary: the sum of its three side lengths. It answers a purely one-dimensional question — how far you would walk if you started at one corner, followed the edges and returned to your starting point. Unlike area, which measures the surface enclosed, perimeter depends only on the edges themselves. For a triangle with sides 3, 4 and 5, the perimeter is simply 3 + 4 + 5 = 12 units, whatever shape those sides enclose. It is often the first measurement a geometer reaches for, because it can be checked physically by laying a piece of string along each edge and adding the three lengths.

Because a triangle is the simplest closed polygon, its perimeter is the simplest possible: add three numbers. There is no factor of two or pi, no squaring, and no need to know any angle. This makes perimeter the first geometric quantity most pupils meet, and it stays useful at every level — surveyors fencing a plot, a joiner cutting trim around a triangular panel and a runner pacing a triangular course all need the same sum. The only requirement is that the three lengths be measured in the same unit. The operation is also easy to reverse: given the perimeter and any two sides, the third follows by simple subtraction.

The three sides cannot be chosen freely. The triangle inequality says that the sum of any two sides must exceed the third, or the figure collapses into a straight line. Sides of 3, 4 and 5 satisfy this — 3 + 4 = 7 is greater than 5 — so a real triangle exists. If the longest side ever equalled the sum of the other two, the triangle would be a degenerate flat segment with zero area, and if it exceeded that sum, no triangle could be drawn at all. The same condition also bounds the shortest side, which must be longer than the difference between the other two.

The semi-perimeter is exactly half the perimeter, written s = P / 2, and it earns its own name because it appears inside Heron's formula for area. With sides 3, 4 and 5 the perimeter is 12, so the semi-perimeter is 6. Heron's formula multiplies s by (s − a), (s − b) and (s − c), then takes the square root: sqrt(6 × 3 × 2 × 1) = sqrt(36) = 6. The half-perimeter turns out to be the natural variable for turning three side lengths into an area without measuring any angle. Working with the half-perimeter also keeps the products balanced and makes the arithmetic manageable by hand.

The 3-4-5 triangle is the best-known example of a right-angled triangle, because 3² + 4² = 9 + 16 = 25 = 5². That means the two shorter sides meet at a right angle, and the ordinary area formula gives half the base times the height: 3 × 4 / 2 = 6. Heron's formula, which knows nothing about right angles, returns the same 6. This agreement is a useful check: whenever a triangle happens to be right-angled, the two independent methods must coincide. It also gives a concrete way to remember the result: the sides 3 and 4 act as base and perpendicular height, so no trigonometry is needed.

Identifying the longest side matters because it is the hypotenuse in a right-angled triangle and the side opposite the largest angle in any triangle. Here it is 5. In general the longest side is simply the maximum of the three lengths, and it can never reach half the perimeter — the triangle inequality forces it to be shorter than the other two combined. Knowing which side is longest also tells you which angle is largest, since larger sides always face larger angles. In practical surveying the longest edge also determines the span a tape measure or a gate must cover.

Perimeter scales linearly while area scales with the square. Double every side of the 3-4-5 triangle to 6, 8 and 10 and the perimeter doubles from 12 to 24, but the area quadruples from 6 to 24, since sqrt(12 × 6 × 4 × 2) = sqrt(576) = 24. This distinction is the source of many errors: a scale factor of k multiplies lengths by k, areas by k² and volumes by k³. Keep the three separate when resizing a shape. A useful mental check is that the perimeter always grows in direct proportion to the sides, with no hidden constant.

A neat relationship links the quantities on this page. The inradius — the radius of the circle that fits perfectly inside the triangle — equals the area divided by the semi-perimeter, r = A / s. For our triangle that is 6 / 6 = 1, a clean whole number that falls out of the 3-4-5 case. The same semi-perimeter that feeds Heron's formula therefore also connects area to an inscribed circle, showing how tightly these measurements are tied together. The same quantity appears in formulas for the area of a quadrilateral inscribed in a circle.

In practice perimeter is a measurement, not a theoretical value, so care with units pays off. Add metres to metres and centimetres to centimetres; the answer inherits the unit of the sides, not a squared unit. Rounding each side before adding can accumulate small errors, so keep full precision until the final step. Whether you are estimating the edging for a garden bed or the binding around a triangular flag, the arithmetic is the same sum — only the unit and the required precision change. Digital tools hold the full precision for you, but the underlying operation is still the plain addition of three edges.

Formula

P = a + b + c

Formula page →

The perimeter is the sum of the three side lengths. It is a one-dimensional measure in the same unit as the sides and requires no angles or additional geometry.

SymbolMeaning
aFirst side length
bSecond side length
cThird side length

A = sqrt(s(s - a)(s - b)(s - c)), where s = (a + b + c) / 2

Formula page →

Heron's formula finds the area from the three sides alone. The semi-perimeter s is half the perimeter, and the area is the square root of s times the three differences between s and each side.

SymbolMeaning
sSemi-perimeter
AArea of the triangle
aFirst side length

L = max(a, b, c)

Formula page →

The longest side is simply the maximum of the three lengths. In a right-angled triangle it is the hypotenuse, and it always faces the largest interior angle.

SymbolMeaning
LLongest side
aFirst side length
bSecond side length

How To Calculate The Perimeter Of A Triangle

  1. 1

    Measure all three sides in the same unit

    Write down the lengths a, b and c, converting them so every side uses one unit. Mixing metres and centimetres is the fastest way to a wrong perimeter, and the answer can only be as consistent as the inputs.

  2. 2

    Add the sides to find the perimeter

    Compute P = a + b + c. For the worked triangle, 3 + 4 + 5 = 12. This single sum is the perimeter, the total distance around the boundary, expressed in the same length unit as the sides.

  3. 3

    Halve the perimeter for the semi-perimeter

    Divide the perimeter by two: s = P / 2. Here 12 / 2 = 6. The semi-perimeter is not an end in itself but the key intermediate value that Heron's formula needs to turn the three sides into an area.

  4. 4

    Apply Heron's formula for the area

    Evaluate sqrt(s × (s − a) × (s − b) × (s − c)). With our numbers that is sqrt(6 × 3 × 2 × 1) = sqrt(36) = 6. Notice the three bracketed terms are the amounts by which the semi-perimeter exceeds each side.

  5. 5

    Pick out the longest side

    Take the maximum of a, b and c. For sides 3, 4 and 5 the longest is 5. Because 3² + 4² = 5², this is the hypotenuse of a right-angled triangle, and it must always be shorter than the sum of the other two sides.

Examples

Example 1: The classic 3-4-5 right-angled triangle

sideA
3
sideB
4
sideC
5
StepCalculationResult
Add the three sides3 + 4 + 512.0
Semi-perimeter12.0 / 26.0
Heron's areasqrt(6 × (6 − 3) × (6 − 4) × (6 − 5))6.0
Longest sidemax(3, 4, 5)5.0
Perimeter3 + 4 + 512.0

Result: Perimeter 12.0 units, semi-perimeter 6.0, area 6.0 square units and longest side 5.0 — a right-angled triangle where Heron's area agrees with half the base times the height.

Example 2: A 5-12-13 right-angled triangle

sideA
5
sideB
12
sideC
13
StepCalculationResult
Add the three sides5 + 12 + 1330.0
Semi-perimeter30.0 / 215.0
Heron's areasqrt(15 × (15 − 5) × (15 − 12) × (15 − 13))30.0
Longest sidemax(5, 12, 13)13.0
Perimeter5 + 12 + 1330.0

Result: Perimeter 30.0 units, semi-perimeter 15.0, area 30.0 square units and longest side 13.0 — again a right triangle, since 5² + 12² = 13².

Example 3: An equilateral triangle with sides of 7

sideA
7
sideB
7
sideC
7
StepCalculationResult
Add the three sides7 + 7 + 721.0
Semi-perimeter21.0 / 210.5
Heron's areasqrt(10.5 × (10.5 − 7) × (10.5 − 7) × (10.5 − 7))21.2176
Longest sidemax(7, 7, 7)7.0
Perimeter7 + 7 + 721.0

Result: Perimeter 21.0 units, semi-perimeter 10.5, area about 21.2176 square units and longest side 7.0 — with all sides equal, every side is equally the longest.

Calculator

Perimeter

12

Semi-perimeter
6
Area (Heron)
6
Longest side
5

Values update as you type. This calculator covers the single scenario its formula assumes — see Common Mistakes for what it leaves out.

Prefer a full-width tool? Open the The Perimeter Of A Triangle calculator page.

Common Mistakes

  • Mixing units between sides

    Adding a side in metres to one in centimetres gives a meaningless perimeter. Convert every length to a single unit before adding, and state that unit alongside the answer.

  • Forgetting the triangle inequality

    Lengths such as 2, 3 and 9 cannot form a triangle, because 2 + 3 is less than 9. Check that any two sides together exceed the third before computing a perimeter or area, or the result describes no real shape.

  • Confusing perimeter with area

    Perimeter is a length measured in metres or centimetres, while area is measured in square units. Reporting 12 square metres for the perimeter of a 3-4-5 triangle mixes two different kinds of quantity.

  • Halving the wrong quantity in Heron's formula

    The semi-perimeter is half the perimeter, not half of any one side. Use s = (a + b + c) / 2, then subtract each full side from that total before multiplying under the square root.

  • Rounding the sides too early

    Rounding each measured side before adding, or before evaluating Heron's formula, compounds small errors. Keep full precision through every intermediate step and round only the final reported value.

  • Assuming the longest side is always listed last

    The longest side is the maximum of the three values, wherever it appears in the input. Taking the third side for granted as the hypotenuse only works in the conventional 3-4-5 labelling, not in general.

FAQ

How do you find the perimeter of a triangle?

Add the three side lengths together: P = a + b + c. Make sure all three are in the same unit first. For sides of 3, 4 and 5 the perimeter is 12, and the answer carries the same length unit as the sides. The result is a length, not a squared quantity.

What is the semi-perimeter and why does it matter?

The semi-perimeter is half the perimeter, s = P / 2. It matters because Heron's formula uses it to compute the area from the three sides alone, and because the area divided by the semi-perimeter gives the inradius of the triangle.

Can any three lengths form a triangle?

No. The sum of any two sides must be strictly greater than the third. If the longest side equals or exceeds the sum of the other two, the lengths collapse into a straight line or cannot close at all, so no valid triangle exists.

How does Heron's formula give the area of a 3-4-5 triangle?

The semi-perimeter is 6. Heron's formula gives sqrt(6 × (6 − 3) × (6 − 4) × (6 − 5)) = sqrt(6 × 3 × 2 × 1) = sqrt(36) = 6. This matches the right-triangle method of half the base times the height.

Which side of a triangle is the longest?

It is the greatest of the three lengths, and it always lies opposite the largest interior angle. In a right-angled triangle the longest side is the hypotenuse. For sides 3, 4 and 5, the longest side is 5.

What happens to the perimeter when a triangle is scaled up?

Perimeter scales linearly: multiplying every side by a factor k multiplies the perimeter by k. Area, by contrast, scales by k². Doubling the sides of a 3-4-5 triangle gives a perimeter of 24 but an area of 24, four times the original 6.

References

  1. [1]Wikipedia, Triangle — https://en.wikipedia.org/wiki/Triangle
  2. [2]Wikipedia, Perimeter — https://en.wikipedia.org/wiki/Perimeter
  3. [3]Wikipedia, Heron's formula — https://en.wikipedia.org/wiki/Heron%27s_formula