Skip to main content
Calcimator

Perimeter Calculator

Calculate the perimeter of rectangles, circles (circumference), triangles, and regular polygons with any number of sides.

About this calculator

This calculator computes the perimeter (or, for a circle, the circumference) of one of four shapes selected via Shape: rectangle, circle, equilateral triangle, or regular polygon — each using its own formula in a switch(shape) block, from P = 2(l + w) for a rectangle to P = n × s for a polygon of n sides. Length dominates the result for the default rectangle: a ten percent nudge on Length moves Perimeter about twice as much as the same-sized nudge on Width, because both are equally weighted in the sum but Length starts twice as large (10 versus 5), so the same percentage nudge produces a bigger absolute change.

Number of Sides genuinely has zero effect on Perimeter at the default Rectangle shape — not a probe artifact, but a direct consequence of the code: case 0 in the switch statement computes 2 * (length + width) and never reads the sides variable at all, so the Number of Sides field only appears once Shape is switched to Regular Polygon, where it starts to matter. What the calculator does NOT account for: Width is silently ignored for every shape except the rectangle, with no warning shown when it's left at a nonzero value.

Inputs

units
units

Results

Perimeter

30 units

Formula UsedP = 2(l + w)
How to Use This Calculator
  1. Select the shape (rectangle, circle, equilateral triangle, or regular polygon) from the Shape dropdown.
  2. Enter the required dimensions for your shape — length and width for rectangles, radius for circles, or a single side length for equilateral triangles and regular polygons.
  3. Perimeter formulas: rectangle = 2(l+w); circle (circumference) = 2πr; equilateral triangle = 3s; regular polygon = n × s.
  4. For a regular polygon, also set the number of sides (at least 3) alongside the side length.
  5. Perimeter and area are different — perimeter is the boundary length, area is the enclosed region.
  6. All dimension inputs must be positive; for polygons, the number of sides must be at least 3.

How the result changes with Length / Radius / Side

Length / Radius / SidePerimeter
520 units
7.525 units
1540 units
2560 units

What each input means

Shape
The geometric shape to calculate.
Length / Radius / Side
Length of the shape or side.
Width
Used for rectangles.
Number of Sides
Used for regular polygons.

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    Shape = 0, Length / Radius / Side = 10, Width = 5, Number of Sides = 6 = 4 input(s) provided
  2. Calculate Perimeter
    Perimeter
    30 = 30
  3. Calculate Formula Used
    Formula Used
    P = 2(l + w) = P = 2(l + w)

Engine last updated . Checked against 3 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Why does changing Number of Sides do nothing to the Perimeter by default?

The calculator's default Shape is Rectangle, and the rectangle branch of the engine's switch(shape) statement computes 2 * (length + width) — a formula that never references the sides variable at all. Because of that, the Number of Sides field stays hidden until Shape is changed to Regular Polygon, where the formula becomes sides × length instead and the field appears.

Why does Length affect the Perimeter more than Width does for the default rectangle?

Part of it is the same starting-value effect you'd see in any additive formula: Length defaults to 10 while Width defaults to 5, so a percentage-based nudge to Length produces a bigger absolute change simply because it starts from a bigger number, not because 2(l + w) weights it any differently. But there's a bigger structural reason Length wins across this whole calculator, not just at the rectangle's defaults: switch to Circle, Equilateral Triangle, or Regular Polygon and Width drops out of the formula entirely — those three branches compute perimeter from Length (read as radius or side) and, for the polygon, Number of Sides, with Width never referenced at all. So Length is the one dimension every shape this calculator supports actually depends on, while Width only ever matters for the rectangle case — a much stronger asymmetry than the additive-formula effect alone would produce.

Does Width matter for shapes other than the rectangle?

No. The switch(shape) block only reads Width inside the rectangle case; the circle, triangle, and polygon cases each use only Length (as radius or side length) and, for the polygon, Number of Sides. Leaving Width at a nonzero value while using one of those other shapes has no effect on the computed Perimeter whatsoever.

What formula does the calculator use for a circle's perimeter?

For Shape = Circle, the engine computes the circumference as 2 * Math.PI * length, treating the Length input as the radius rather than a side length. That is a different physical quantity from every other shape's Length field, which is why the input's own help text labels it "Length / Radius / Side" rather than just "Length."

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Math & Statistics.