About the Perimeter Calculator
Perimeter is the distance all the way around the outside of a shape. Walk the boundary of a field and the distance you cover is its perimeter.
It is the measurement you need for anything that goes around rather than across: fencing, edging, skirting board, picture framing, coving, kerbing, trim, weather seal, the wire round a garden bed, the ribbon round a cake.
For most shapes, finding it is genuinely just addition — add up the sides. This page covers seven shapes, and it is honest about the fact that five of them need no formula at all. The two that do are the circle, where π enters, and the ellipse, which turns out to be one of the hardest ordinary-sounding problems in geometry.
How to Use the Perimeter Calculator
Choose your shape and enter its measurements. All measurements must be in the same unit; the perimeter comes back in that unit.
Unlike area, no perpendicular height is ever needed here. The perimeter cares only about the boundary, not about how tall or squashed the shape is. A parallelogram leaning at 80° and one leaning at 20° have identical perimeters if their sides match, even though their areas differ enormously.
The Formulas
Rectangle P = 2(l + w)
Square P = 4s
Triangle P = a + b + c
Parallelogram P = 2(l + w)
Trapezoid P = a + b + c + d
Regular polygon P = n × s
Circle P = 2πr = πd
Ellipse no exact elementary formula — see below
The first five are addition with a shortcut where sides repeat. A rectangle has two pairs of equal sides, so add one of each and double. A regular polygon has n equal sides, so multiply.
The circle needs π because the boundary is curved, and π is defined as the number of diameters that fit around a circle — a little over three, for every circle that has ever existed.
The Ellipse Is Genuinely Hard
Here is something that surprises people. The area of an ellipse is πab — as simple as the circle. Its perimeter has no exact formula in terms of elementary functions at all.
The true perimeter is an elliptic integral:
P = 4 ∫₀^(π/2) √( a² sin²t + b² cos²t ) dt
which cannot be reduced to any finite combination of roots, powers, logs and trig functions. This is not a gap in anyone's knowledge; it is provably impossible, and the whole field of elliptic integrals grew out of the attempt.
So everyone uses approximations. The famous one is Ramanujan's:
P ≈ π [ 3(a + b) - √( (3a + b)(a + 3b) ) ]
which is remarkable work — but its accuracy depends heavily on how flattened the ellipse is:
| Aspect ratio | Ramanujan's relative error | |--------------|---------------------------| | 1:1 (a circle) | exact | | 1.5:1 | 0.00000013 | | 10:1 | 0.00084 | | 100:1 | 0.0034 |
Near-circular, it is superb. On a long thin ellipse it drifts, and 0.3% of a large boundary is a real quantity of material.
This calculator does not use an approximation formula. It evaluates the integral numerically instead, which holds the error to around eleven decimal places at every aspect ratio, and costs about a tenth of a millisecond. Ramanujan's value is still shown in the working, alongside its actual error for your ellipse, because the comparison is worth seeing.
Avoid the version sometimes quoted as a quick fix, 2π√((a² + b²)/2). It is noticeably worse than Ramanujan's, and the calculator shows what it would have given so you can see the gap.
Perimeter and Area Scale Differently
This is the most useful thing to understand about perimeter, and it follows from perimeter being a length.
Double every dimension of a shape and:
- the perimeter doubles — direct proportion
- the area quadruples — the square of the scale
So bigger shapes get relatively cheaper to enclose. A square field of side 100 m has 400 m of fence for 10,000 m² of grass: 25 m² per metre of fence. Double it to 200 m a side and you have 800 m of fence for 40,000 m²: 50 m² per metre. Same fence per side, twice the value from it.
This is why large farms fence more cheaply per hectare than small ones, why a large water tank loses proportionally less heat than a small one, and why small animals must eat so much more for their size — their surface area is large relative to their volume, so they lose heat fast.
Which shape needs the least boundary?
For any given area, the circle has the smallest perimeter. Always. Among rectangles the square is best, among triangles the equilateral one, and in general the more regular and the rounder a shape, the less boundary it needs to enclose the same space.
| Shape enclosing 100 m² | Perimeter | |------------------------|-----------| | Circle | 35.4 m | | Square | 40.0 m | | 2:1 rectangle | 42.4 m | | 10:1 rectangle | 69.6 m |
The square needs 13% more boundary than the circle, and a 10:1 rectangle needs almost exactly twice as much. This is why soap bubbles are spherical — surface tension pulls toward the least surface for the volume — and why a circular grain silo uses the least steel.
Step-by-Step Example
Fencing a garden. A rectangle 12 m by 8 m.
P = 2 × (12 + 8) = 2 × 20 = 40 m
With a 1 m gate, order 39 m of fencing — and a post every 2 m means 20 posts.
Edging a circular bed. Radius 1.5 m.
P = 2 × π × 1.5 = 9.4248 m
Order 10 m.
A trapezoidal plot. Parallel sides 8 and 14 m, legs 5 m each.
P = 8 + 14 + 5 + 5 = 32 m
No height needed — that only matters for the area.
An elliptical flower bed. Semi-axes 6 m and 4 m, so 12 m by 8 m overall.
True perimeter: 31.7309 m
Ramanujan: 31.7309 m (error 1.3 × 10⁻⁷ — indistinguishable here)
At this near-round shape the approximation is fine. Stretch it to 10 m by 1 m and Ramanujan gives 40.606 against a true 40.640 — a 34 mm shortfall you would notice when the edging ran out.
Understanding Your Result
The perimeter is in the same unit you entered.
The formula used names the rule applied.
The shape describes what the calculator understood, and flags special cases — that your rectangle is a square, your parallelogram a rhombus, your ellipse actually a circle.
The scaling line gives the perimeter at double and triple size, as a reminder that it scales in direct proportion while area does not.
The accuracy line says whether the answer is exact. For everything except the ellipse it is, because adding up sides is exact. For the ellipse it states how the figure was obtained.
When Should You Use This Calculator?
Fencing and walling. The classic case, and posts are usually the bigger cost, so you need the length before you can count them.
Skirting, coving and architrave. Room perimeter, less doorways.
Picture framing. The moulding needed is the perimeter, plus an allowance at each mitre.
Kerbing and path edging. Straight runs plus curved sections.
Seals and weatherstripping. Around doors, windows and hatches.
Ribbon, trim and binding. Around a cake, a quilt, a rug or a table.
Running tracks and routes. A lap is a perimeter, which is why outer lanes start further forward — each lane has a larger radius on the bends.
Land boundaries. The perimeter sets the fencing, the hedging and often the boundary maintenance obligation.
Common Mistakes
Confusing perimeter with area. Perimeter is a length, in metres. Area is a surface, in square metres. Fencing is bought by the metre; turf by the square metre.
Forgetting that a rectangle has four sides. l + w is half the perimeter. The whole is 2(l + w).
Using the radius where the formula wants the diameter, or vice versa. C = 2πr and C = πd are the same statement. Mixing them gives an answer double or half what it should be.
Expecting to get the perimeter from the area. You cannot, in general. A 1 × 36 rectangle and a 6 × 6 square both cover 36 square units, with perimeters of 74 and 24.
Trying to use a height in a perimeter formula. It never appears. Only the boundary lengths matter.
Treating an approximate ellipse perimeter as exact. Most calculators and textbooks use Ramanujan's formula without saying so. It is excellent near-circular and drifts as the ellipse flattens.
Adding three sides that cannot form a triangle. If two sides do not together exceed the third, the shape does not close, and their sum is not a perimeter of anything. This calculator checks.
Forgetting gates, doorways and openings. The perimeter is the full boundary; what you order is usually the perimeter minus the gaps.