Perimeter Calculator: Circle, Rectangle and Triangle
Perimeter calculator: circle circumference from the radius, plus the distance around rectangles, triangles, semicircles and eight other shapes.
Perimeter · Rectangle
- In in
- 27.55905512 in
- Area
- 300 cm²
- Diagonal
- 25 cm
How to use the Perimeter Calculator
- Choose the shape, such as Rectangle, Circle (circumference) or Right triangle (two legs).
- Pick the unit your measurements are in, for example meters or feet.
- Enter each side or radius. The perimeter updates as you type, with its formula shown under it.
- Check the extra figures below the result, such as the area, diagonal or hypotenuse, and the perimeter in the other unit system.
Formula
Rectangle P = 2 × (l + w) · Triangle P = a + b + c · Circle C = 2 × π × r
Where:
- P
- Perimeter: the total length of the boundary, in the unit you entered
- C
- Circumference: the perimeter of a circle
- l, w
- Length and width of a rectangle
- a, b, c
- The side lengths of a triangle
- r
- Radius: the distance from a circle's center to its edge, half the diameter
- π
- Pi, about 3.14159265 (the calculator uses 40 digits)
Each shape's own formula is shown under the result. The ellipse uses Ramanujan's approximation because an oval has no exact simple formula; it is exact for a circle and within a small fraction of a percent otherwise.
Worked example
A rectangular backyard garden measures 40 ft by 25 ft. Fencing costs $18 per linear foot, installed. How much fencing do you need, and what does it cost?
- P = 2 × (l + w) = 2 × (40 + 25) = 2 × 65 = 130 ft.
- In metric, 130 ft × 0.3048 = 39.624 m.
- Cost = 130 × $18 = $2,340.
You need 130 linear feet (about 39.62 m) of fencing, costing about $2,340 at $18 per foot.
Circumference of a circle from radius or diameter
A perimeter is the total length of a shape's boundary. For a circle that length has its own name, the circumference, but it is the same idea: C = 2 × π × r, or C = π × d if you measured straight across. Pick Circle (circumference) and the page works as a circumference calculator. It asks for the radius only, so a diameter has to be halved before you type it; the diameter and the area are then listed under the result.
The tool works forward, from radius to circumference. Going backward takes one line by hand:
- Diameter from circumference: d = C ÷ π, and the radius is half of that. A tape wrapped around a tree trunk reads 94.2 cm, so the trunk is about 29.98 cm across.
- Circumference from area: r = √(A ÷ π), then C = 2 × π × r. A round lawn of 50 m² has a radius of about 3.99 m and an edge of about 25.07 m.
Perimeter of a rectangle, square and triangle
Straight-sided shapes are sums of their edges. A rectangle is P = 2 × (l + w), a square is P = 4 × s and a triangle is P = a + b + c. Unlike area, perimeter never uses a perpendicular height: measure along each edge, slanted ones included.
Two checks run on what you enter. Three lengths only form a triangle if each is shorter than the other two combined, and four lengths only close into a four-sided shape if the longest is shorter than the other three together. When they cannot, a message appears in place of a number. For a right triangle you can skip a side: enter the two legs and the hypotenuse is found with Pythagoras.
Worked example. A bedroom is 4.2 m long and 3.6 m wide, with one door 0.9 m wide where no baseboard goes.
- Room: 2 × (4.2 + 3.6) = 2 × 7.8 = 15.6 m.
- Minus the doorway: 15.6 − 0.9 = 14.7 m.
- Baseboard sold in 2.4 m lengths: 14.7 ÷ 2.4 = 6.125, so buy 7 lengths.
Semicircles, arcs and other curved edges
A half or quarter circle is not half or a quarter of the circumference, because the straight edges count too.
- Semicircle: P = π × r + 2 × r. An arched window with a radius of 0.6 m has a curved edge of about 1.885 m and a straight edge of 1.2 m, about 3.085 m of trim in total. If the frame already covers the straight edge, only the 1.885 m arc is needed; both parts are listed separately.
- Quarter circle: choose Circle sector with a 90° angle. For a radius of 3 m the arc is about 4.712 m and the two radii add 6 m, so the perimeter is about 10.712 m.
- Any arc: the sector option takes a radius and an angle from 0° to 360° and shows the arc length on its own line, so it doubles as an arc length calculator.
- Ellipse (oval): there is no exact simple formula. The result uses Ramanujan's 1914 approximation, which is exact for a circle and off by far less than a tape measure can detect for everyday ovals.
Perimeter formulas for all 12 shapes
| Shape | Formula | You enter |
|---|---|---|
| Square | P = 4s | side |
| Rectangle | P = 2(l + w) | length, width |
| Triangle | P = a + b + c | three sides |
| Right triangle | P = a + b + √(a² + b²) | the two legs |
| Circle | C = 2πr | radius |
| Semicircle | P = πr + 2r | radius |
| Circle sector | P = 2r + (θ ÷ 360) × 2πr | radius, angle |
| Ellipse | P ≈ π(a + b)(1 + 3h ÷ (10 + √(4 − 3h))), h = (a − b)² ÷ (a + b)² | the two semi-axes |
| Parallelogram | P = 2(a + b) | two adjacent sides |
| Trapezoid (trapezium) | P = a + b + c + d | all four sides |
| Rhombus | P = 4s | side |
| Regular polygon | P = n × s | number of sides (3 to 1,000), side length |
From perimeter to linear feet of fence or trim
Fencing, baseboard and edging are sold in linear feet or linear meters. The amount to buy is the perimeter with three adjustments:
- Subtract openings. Gates, doors and driveways need no material, so take their widths off the full figure.
- Add for joins. Mitered corners and offcuts waste material; about 10% extra is common for trim.
- Convert last. Measure in one unit, calculate, then read the other-system figure under the result or use the length converter.
Perimeter and area are independent. A 10 × 10 square and an 18 × 2 rectangle both measure 40 around, yet enclose 100 and 36 square units.
Assumptions
Shapes are treated as flat, with straight sides or exact curves, and every side is measured along its edge. Boundaries that follow uneven ground are longer. Results use 40 significant digits and are displayed rounded to 10; the ellipse figure is a close approximation, not an exact value.
Frequently asked questions
How do I find the circumference from the diameter?
Multiply the diameter by π: C = π × d. A 2.4 m circular bed has a circumference of about 7.54 m. The Circle option here asks for the radius, so halve the diameter first and enter 1.2; C = 2 × π × r gives the same answer, and the diameter is listed under the result.
How do I find the perimeter of a rectangle?
Add the length and the width, then double the sum: P = 2 × (l + w). A rectangle 20 cm by 15 cm has a perimeter of 70 cm. A square is the special case with four equal sides, so P = 4 × s. The area and the diagonal are shown alongside, since the same two measurements fix them.
How do I find the perimeter of a triangle?
Add the three sides: P = a + b + c. Sides of 5, 6 and 7 give 18. For a right triangle where you only know the two legs, find the third side with Pythagoras, c = √(a² + b²), then add all three: legs of 6 and 8 give a hypotenuse of 10 and a perimeter of 24. Choose Right triangle (two legs) for that.
How do I find the perimeter of a circle?
The perimeter of a circle is its circumference; the two words mean the same length. Use C = 2 × π × r, so a circle with a radius of 4 cm measures about 25.13 cm around. Circumference is only used for circles and ovals, while perimeter applies to any closed shape.
How do I calculate linear feet for a fence?
A linear foot is simply a foot of length measured along a line, so the linear feet of fence equal the perimeter of the area you enclose, minus any gaps. A yard 40 ft by 25 ft has a perimeter of 130 ft; leaving a 4 ft opening for a gate means buying 126 linear feet of fencing, about 38.40 m.
How do I find the perimeter of a half-circle?
Add the curved half of the circumference to the straight edge: P = π × r + 2 × r. The straight edge is the diameter, so a semicircle is more than half of the full circle's circumference. If you only need the curved part, such as for a garden arch, use the curved edge (arc) figure listed under the result.
Related calculators
- Area CalculatorArea calculator: square feet, square meters or six other units for 12 shapes, from rectangles and circles to a triangle with three known sides.
- Distance CalculatorDistance calculator with latitude and longitude for the great-circle distance and bearing between two places, plus 2D and 3D point distances.
- Surface Area CalculatorLateral surface area calculator for cylinders, cones, prisms and pyramids, with the total area, slant height and volume of 11 solids.
- Volume CalculatorA volume calculator in liters, US gallons and cubic units for 12 solids, from boxes and cylinders to cones, spheres and tubes.
- Length ConverterUse this length converter: feet to meters, cm to inches, miles to km or any pair of nine units, with exact factors and every unit listed.
Last updated: