Skip to main content
CalcMax

Perimeter Calculator

Range: 0 cm – 1,000,000,000 cm

Range: 0 cm – 1,000,000,000 cm

Range: 0 cm – 1,000,000,000 cm

Result

14.0000 cm

Perimeter

A perimeter calculator gives the distance all the way around a shape: the length of fence a plot needs, the length of trim a table edge takes, the length of skirting a room wants. Pick the shape, give it its sides, and the page returns one number in centimetres. There are three shapes here and three formulas, and two of them are the sort of thing you can do without thinking. A square has four equal sides, so its perimeter is four times the side. A rectangle has two pairs of equal sides, so its perimeter is twice the sum of its length and its width. A triangle has three sides with no relation between them at all, so its perimeter is simply their sum. That last one is the only interesting case, and the reason is that a triangle's three sides are not free to be anything you like. Pick any two lengths and lay them end to end, and the third side has to reach from one loose end to the other: if the two you picked are too short to span the gap, no triangle closes and the numbers describe nothing. The rule is that any two sides added together must be longer than the third, and it has to hold for all three pairings. Two and three and ten does not make a triangle, and neither does one and one and two — the second of those is the boundary case, where the two short sides add up to exactly the long one and the shape collapses into a straight line rather than closing. The page refuses both rather than returning a perimeter, and that is a deliberate choice: a row of sides that cannot close has a sum, but calling that sum a perimeter would tell you the length of a fence for a plot that does not exist. Everything stays in centimetres regardless of the unit dropdowns, and the answer is exact whenever the sides are, since there is no π and no square root anywhere on this page.

Squares, rectangles and triangles from their sides

FormulaSide a (cm)Side b (cm)Side c (cm)Perimeter (cm)
4a5——20
4a2.5——10
2(a + b)34—14
2(a + b)101—22
2(a + b)125—34
a + b + c34512
a + b + c1113
a + b + c681024

Eight rows covering the three shapes, and the first column is what tells them apart: once a row is solved there is nothing left in the numbers to say whether it was a square, a rectangle or a triangle, so the formula stands in for the shape name and doubles as the statement of which of the three side columns were read. That is also what the dashes are for — a square reads one side and has no second or third, so both of the remaining columns carry a dash rather than a zero, which would mean something quite different. The first two rows are squares, and the second is 2.5 centimetres on a side at 10, since the page takes decimals. The next three are rectangles, and the pair on the fourth and fifth rows makes the point that a perimeter does not settle an area: ten by one and twelve by five have perimeters of 22 and 34, and neither figure tells you anything about the other. The last three rows are triangles, and all three pass the inequality with room to spare — six, eight and ten is twice the 3-4-5 triangle, which is why both appear here under the same formula. Every figure is exact, since nothing on this page introduces a π or a square root, and all eight are recomputed from their sides when the page is built.

Formula

Square: P = 4a Rectangle: P = 2(a + b) Triangle: P = a + b + c

Shape
Which of the three you are measuring. It decides which formula runs and therefore which of the three side fields are read: a square reads one, a rectangle reads two, and a triangle reads all three
a
The side, in centimetres. For a square it is the only number the page needs. For a rectangle it is the first of the two, and for a triangle it is one of the three
b
The second side, in centimetres, read by the rectangle and the triangle and ignored by the square, which has no second length to give
c
The third side, in centimetres, read by the triangle alone. For the triangle the three fields are interchangeable — nothing depends on which of the three you call a, b or c
The triangle inequality
The rule that keeps a triangle a triangle: any two sides added together must be longer than the third, for all three pairings. The page checks it and refuses a set of sides that breaks it, including the boundary case where the sum is exactly equal rather than less
Centimetres
The unit of the answer, always, whichever unit the dropdowns are set to. A perimeter is a length, so unlike an area it needs no squaring step — the answer is in the same unit as the sides
Four decimal places
How wide the answer is written. Four rather than two so that a perimeter in metres entered through the dropdown keeps enough digits to be useful, and so that the decimal sides on the reference table print in full rather than being rounded away

The shape picker is there because the three formulas are different, but the choice is usually made for you by what you are measuring. A square is for tiles, panels and square plots, where all four sides really are the same and one measurement will do. A rectangle is for rooms, gardens, screens and sheets, where you have a length and a width and the two pairs are equal. A triangle is for the awkward plot at the end of a road, a gable end, a bracket or a ramp, and it is the one where you need all three sides — there is no formula that gets the third from the other two, because the three sides of a triangle are independent in a way that the sides of a rectangle are not. Two things are worth carrying over from the geometry around this page. The first is that the perimeter of a rectangle is not proportional to its area: a one by ten rectangle and a five by six rectangle have the same perimeter of twenty-two, but the first encloses ten square units and the second thirty, which is the classical reason a long thin field needs more fencing than a square one of the same size. The second is the triangle inequality, which is the single most useful thing on this page because it is what stops a set of three numbers from being a triangle at all — and it is why the shortest path between two points is the straight one, since any detour through a third point makes the trip longer.

Worked examples

  1. A rectangle 3 by 4

    1. Two lengths and two widths: 2 × (3 + 4) = 14
    2. Or four sides added one at a time: 3 + 4 + 3 + 4 = 14
    3. The third field is not read by the rectangle, and the 5 sitting in it changes nothing

    The shape the page loads with. The two ways of writing the arithmetic are the same calculation, and seeing that is the point: the formula doubles a sum rather than adding four terms, which is where the bracket comes from. The 3-4-5 triangle in the third field is a leftover from a triangle you might have looked at before, and the page takes no notice of it.

  2. A square of side 5

    1. Four equal sides: 4 × 5 = 20
    2. The second and third fields are not read by the square

    The simplest row on the page, and the one to sanity-check the whole thing against: a square five centimetres on a side has twenty centimetres of edge. Worth noticing that the square could be reached through the rectangle formula as well, since a square is a rectangle with both sides equal — 2 × (5 + 5) = 20 — and the page keeps a separate option because asking for one number instead of two is the whole reason people pick a square.

  3. A triangle with sides 3, 4 and 5

    1. Three sides added: 3 + 4 + 5 = 12
    2. Check the inequality: 3 + 4 = 7 is more than 5, 3 + 5 = 8 is more than 4, and 4 + 5 = 9 is more than 3
    3. All three pairings hold, so the triangle closes

    The smallest whole-number right triangle, and the only one of these examples where the inequality check is worth writing out — the test is not whether the longest side looks long but whether every pairing passes, and all three do here with room to spare. The perimeter of 12 is the same figure the 3-4-5 triangle gives on the area page for the same sides, where it happens to be an area of 12 rather than a perimeter.

  4. A triangle with sides 6, 8 and 10

    1. Three sides added: 6 + 8 + 10 = 24
    2. Check the inequality: 6 + 8 = 14 is more than 10, and both other pairings hold with room to spare
    3. The triangle closes

    Twice the 3-4-5 triangle, and it also demonstrates something worth knowing: scaling a triangle doubles the perimeter, because a perimeter is a length. The two are the same shape at different sizes, which is why both appear in the first column of the reference table as the same formula.

  5. An isosceles triangle with sides 5, 5 and 6

    1. Three sides added: 5 + 5 + 6 = 16
    2. Check the inequality: 5 + 5 = 10 is more than 6, and 5 + 6 = 11 is more than 5
    3. All three pairings hold, so the triangle closes

    The narrowest triangle on this page, and the one to check the inequality against rather than the 3-4-5. Two sides of five and a base of six is as close as these numbers come to failing: the two short sides add up to ten against a longest side of six, which passes with four to spare. Push the base out to ten and the two fives meet exactly along it, which is the case the page refuses — see the limitations below for why a set of sides that cannot close is not given a perimeter rather than being given the sum of its sides.

Limitations

The page is for three shapes only: a square, a rectangle and a triangle. A parallelogram needs a side that a rectangle does not, a circle has a circumference rather than a perimeter, and a general quadrilateral cannot be described by four numbers without also knowing its angles. The outputs are in centimetres whatever unit the dropdowns are set to. Every field stays on screen for every shape and the ones that are not read are ignored rather than cleared, so a number left over from a previous shape changes nothing and the page will not tell you it went unused. The triangle's three sides are checked against the triangle inequality and a set that fails is refused rather than answered, which includes the boundary case where two sides add up to exactly the third — that is a straight line rather than a triangle and its sum is not a perimeter. A triangle is not checked for anything beyond that: there is no test for a right angle, no attempt to work out which side is the base, and no area, which is why the perimeter of a triangle is one number while describing the triangle takes three. Four decimal places is a display width rather than a claim about precision, and the answer is exact whenever the sides are, since nothing on this page introduces a rounding step of its own.

Frequently asked questions

Which fields does each shape use?
The square reads the first side and nothing else. The rectangle reads the first two. The triangle reads all three. Every field stays on screen and keeps whatever is in it, so a number left over from a shape you looked at earlier does nothing at all. The formula column of the reference table is the quickest way to see which numbers went into a given row.
Why will it not accept sides of 1, 1 and 2?
Because those three lengths do not close into a triangle. The two short sides laid end to end reach exactly as far as the long one, so the figure lies flat along a straight line instead of enclosing an area. The rule is that any two sides must add up to strictly more than the third, and the equal case fails it just as the impossible ones do. Their sum of four is a real number but it is not a perimeter.
Is a perimeter the same as an area?
No, and the two do not track each other. A one by ten rectangle and a five by six rectangle both have a perimeter of twenty-two, but the first encloses ten square units and the second thirty. A perimeter is a length measured in centimetres; an area is measured in square centimetres. This page returns only the perimeter, and the shapes here have their areas worked out on other pages.
Why does a square have its own option when the rectangle would do?
Because a square needs one number and a rectangle needs two, and making someone type the same length twice is a worse form than giving the square its own option. The arithmetic is the same either way: a square is a rectangle whose two sides happen to be equal, and 4 × 5 comes to the same twenty as 2 × (5 + 5).
How do I convert the answer to metres or feet?
Divide by a hundred for metres, since a perimeter is a length and the conversion is the ordinary one. For imperial units use the dropdown on the input side instead, which converts your sides into centimetres on the way in and leaves the answer in centimetres — so a rectangle entered in feet comes back as a centimetre answer, and dividing by 30.48 gives the figure back in feet.
Can a side be zero?
For a square and a rectangle, yes, and the perimeter comes back as whatever the remaining sides give: a rectangle five by zero returns ten, a shape flattened into a line. For a triangle it depends, because the inequality still has to hold — sides of 5, 0 and 5 fail it, since the two fives add up to more than zero but the zero and a five do not add up to more than the other five. The page tells you rather than guessing which you meant.

References

Related calculators