Perimeter Formula Calculator – Calculate Perimeter of Any Shape Instantly
Give this calculator a shape and its dimensions and it returns the perimeter with the formula written out and your numbers substituted, so you can follow every step. It covers ten shapes: squares, rectangles, parallelograms, circles by radius or diameter, equilateral and scalene triangles, regular pentagons and hexagons, and ellipses, where the famous Ramanujan approximation is used and labeled honestly as an approximation. A rectangle 8 by 5 is pre-filled: press Calculate and you get 26.0000 with P = 2(8 + 5) shown.
The tool is unitless: the answer carries whatever unit your inputs use (inches, feet, meters). The ellipse uses Ramanujan’s approximation, labeled as such in the formula line.
Quick Answer
A rectangle 8 by 5 has a perimeter of 26.0000: P = 2(8 + 5). For polygons, perimeter is the sum of the side lengths (square 4s, triangle a + b + c); a circle uses 2πr or πd. An ellipse has no exact elementary formula, so this page uses Ramanujan’s approximation: a 5-by-3 ellipse gives 25.5270, matching the true value to four decimals.
Key takeaways
- The tool shows the formula with your numbers substituted, not just a bare answer: check the substitution line before trusting the result.
- Perimeter is a length, not an area: doubling every side doubles the perimeter but quadruples the area.
- Circumference is the same idea as perimeter, reserved by convention for circles.
- The ellipse result is an approximation. For ordinary axis ratios it is accurate to about four decimals; for very flat ellipses (10:1 and beyond) the error grows.
- Quick Answer
- How to use the perimeter formula calculator
- Worked example: rectangle 8 by 5, checked against this exact tool
- All ten formulas, with variables defined
- Why the ellipse is an approximation
- Perimeter vs area vs circumference
- What competing calculators miss
- Frequently asked questions
- Add This Calculator to Your Website
- References
How to use the perimeter formula calculator
Pick a shape, type its dimensions, and click Calculate perimeter. The result stays hidden until you calculate, and the formula line shows your numbers substituted into the formula so you can check the arithmetic.
- Choose the shape: rectangle is selected by default with the worked-example values (8 by 5) pre-filled. Switch to any of the other nine shapes and the right inputs appear, each with a “?” tooltip explaining the dimension.
- Enter the dimensions: any positive number works, decimals included. The tool is unitless, so 8 can mean 8 inches, 8 feet or 8 meters, and the answer carries the same unit.
- Read the substituted formula: under the answer, the formula line shows the exact substitution, for example P = 2(8 + 5) = 26.0000. If a value looks wrong, the substitution line tells you which input caused it.
- Copy or share: the results area has Copy my results and Share results buttons. Reset restores the rectangle example.
Two honest limits: the tool rejects zero and negative dimensions with a specific message, and the ellipse answer is an approximation (see the section below), not an exact value.
Worked example: rectangle 8 by 5, checked against this exact tool
The pre-filled example runs as P = 2(8 + 5) = 2 × 13 = 26.0000, exactly what the calculator returns. Two more shapes, verified the same way:
Every row below is a real run of this calculator. Type any of them in and you get the same figures to four decimals.
| Shape | Inputs | Perimeter | Substitution shown |
|---|---|---|---|
| Rectangle | l=8, w=5 | 26.0000 | P = 2(8 + 5) |
| Square | s=4 | 16.0000 | P = 4 × 4 |
| Parallelogram | a=6, b=4 | 20.0000 | P = 2 × (6 + 4) |
| Circle (radius) | r=3 | 18.8496 | P = 2 × π × 3 |
| Circle (diameter) | d=10 | 31.4159 | P = π × 10 |
| Triangle (equilateral) | s=6 | 18.0000 | P = 3 × 6 |
| Triangle (scalene) | a=3, b=4, c=5 | 12.0000 | P = 3 + 4 + 5 |
| Pentagon (regular) | s=2.5 | 12.5000 | P = 5 × 2.5 |
| Hexagon (regular) | s=2 | 12.0000 | P = 6 × 2 |
| Ellipse | a=5, b=3 | 25.5270 | Ramanujan approximation |
All ten formulas, with variables defined
Perimeter is the total length around a shape. For every polygon it is the sum of the side lengths; circles and ellipses get their own formulas:
- Square: P = 4s, where s is the side length.
- Rectangle: P = 2(l + w), where l is length and w is width.
- Parallelogram: P = 2(a + b), where a and b are adjacent sides; opposite sides are equal, so they double.
- Circle: P = 2πr = πd, where r is the radius and d the diameter. This length has its own name, the circumference.
- Equilateral triangle: P = 3s.
- Scalene triangle: P = a + b + c, the three sides added.
- Regular pentagon: P = 5s. Regular hexagon: P = 6s. In general a regular n-gon has P = n × s.
- Ellipse: P ≈ π(3(a + b) − √((3a + b)(a + 3b))), Ramanujan’s approximation, where a and b are the semi-major and semi-minor axes.
Need the circle side of the family in more depth, or the area of an oval to pair with an ellipse perimeter? The circle formula calculator covers circle geometry in detail, and the area of an oval calculator handles the ellipse area this page does not compute.
Why the ellipse is an approximation
The ellipse is the only shape here with no exact perimeter formula using elementary functions: the true value is an elliptic integral, not something that simplifies to a tidy equation. So calculators use an approximation, and the standard choice is the one Srinivasa Ramanujan published in 1914: π(3(a + b) − √((3a + b)(a + 3b))).
How good is it? For the 5-by-3 ellipse in the worked example it returns 25.526986 against the true 25.526999, matching to four decimals; an 8-by-5 ellipse gives 41.386264 against 41.386276, the same story. It only drifts on very flat ellipses: at a 10:1 ratio the error is about 0.03. For fencing, framing and homework, that is far beyond the precision of the tape measure. This page labels the ellipse result as an approximation in the formula line itself, because a tool that quietly rounds an approximation into a fake exact answer is worse than one that tells you.
Perimeter vs area vs circumference
Perimeter is the distance around any shape; circumference is the same idea reserved by convention for circles. Do not mix either with area: doubling every side of a rectangle doubles its perimeter but quadruples its area. That scaling fact is the classic exam trap and the classic fencing mistake in one. Fencing, framing, edging and trim need perimeter (a length); paint, flooring and sod need area (a length squared). When a layout problem also needs the geometry of bisected lines, for example setting out right angles on site, the perpendicular bisector calculator is the companion tool.
What competing calculators miss
Perimeter tools fall into three camps, and each leaves a gap this page closes:
- Shape-count leaders (Pearson, num8ers): 13 to 15 shapes, sectors and annuli included. Strength: breadth. Gap: they name the formula but rarely show your numbers substituted into it, so a wrong input produces a confident wrong answer with no audit trail.
- Unit-switch tools (calculators.im): metric/imperial switching and composite shapes. Strength: project planning. Gap: the ellipse is handled with no accuracy discussion, and the substituted working is thin.
- Formula directories (perimetercalculator.net, Omni Calculator): clean tables of all twelve formulas with derivations. Strength: reference value. Gap: they are articles with a calculator attached, not a substituted-formula workflow; the worked examples are static text, not live runs.
- The gap this page fills: every answer ships with the formula and your numbers substituted (P = 2(8 + 5) = 26.0000), the ellipse approximation is labeled and its accuracy quantified against numerical integration (four decimals at ordinary ratios), circles take radius or diameter directly, and every run is reproducible to four decimals.
Frequently asked questions
It depends on the shape: 4s for a square, 2(l + w) for a rectangle, 2πr or πd for a circle, a + b + c for a triangle, and n × s for a regular n-gon. The ellipse uses Ramanujan’s approximation. Pick your shape in the calculator above and the formula line shows the substitution with your numbers.
Use P = 2(l + w): add the sides (8 + 5 = 13) and double the result to get 26.0000. The calculator has this exact example pre-filled; press Calculate perimeter to see the substituted formula.
Use Ramanujan’s approximation: π(3(a + b) − √((3a + b)(a + 3b))), where a and b are the semi-major and semi-minor axes. There is no exact elementary formula; the true value is an elliptic integral.
Yes. Choose “Circle (diameter)” in the shape list and the tool computes perimeter = π × diameter directly, with no conversion step needed.
They are the same concept: the distance around a shape. Circumference is simply the word reserved by convention for circles.
Because no closed-form formula exists for the ellipse perimeter; the calculator uses Ramanujan’s 1914 approximation. At ordinary axis ratios it matches the true value to about four decimals, so for practical work the difference is negligible.
The tool is unitless: the answer carries whatever unit your inputs use. Enter 8 as inches and the answer is in inches; enter meters and it is in meters. Keep all inputs in the same unit.
Add This Calculator to Your Website
Embed this calculator on your own site with the code below. Pick a size to preview it live, then copy the code.
Powered by Calculator Zilo
References
- Ramanujan, S. Modular Equations and Approximations to π, Quarterly Journal of Mathematics, 1914. Accessed October 23, 2026.
- Weisstein, E. W. Ellipse, MathWorld (Wolfram). Accessed October 23, 2026.
- Weisstein, E. W. Regular Polygon, MathWorld (Wolfram). Accessed October 23, 2026.
- Khan Academy. Area and Perimeter. Accessed October 23, 2026.
- OpenStax. Prealgebra 2e (perimeter and area of geometric figures). Accessed October 23, 2026.
- National Institute of Standards and Technology. Guide for the Use of the International System of Units (SP 811). Accessed October 23, 2026.
