# Perimeter Calculator

URL: https://hifreetools.com/calculators/perimeter-calculator

> Pick a shape — square, rectangle, triangle, circle, or parallelogram — enter its measurements, and this calculator returns the perimeter instantly while showing the exact formula it used.

## Quick answer

The perimeter is the total distance around the outside of a 2D shape. The formula depends on the shape: square P = 4s, rectangle P = 2(l + w), triangle P = a + b + c, parallelogram P = 2(a + b), and for a circle the perimeter is the circumference C = 2πr. For example, a square with side 5 has perimeter 4 × 5 = 20, and a circle with radius 7 has circumference 2 × π × 7 ≈ 43.98.

## Formula

- Square P = 4s
- Rectangle P = 2(l + w)
- Triangle P = a + b + c
- Circle C = 2πr
- Parallelogram P = 2(a + b)

Select a shape from the dropdown. The calculator shows only the inputs that shape needs and the matching formula. Each value is read from its field, parsed as a number, and checked to be greater than zero (a side or radius of zero or less has no real shape). The perimeter is then computed live with the shape's formula: square P = 4s, rectangle P = 2(l + w), triangle P = a + b + c, parallelogram P = 2(a + b), and circle C = 2πr using the full-precision Math.PI. The triangle case also checks the triangle inequality — each side must be shorter than the sum of the other two — and warns if the three lengths cannot form a triangle. Results are displayed to six significant figures for readability, but the underlying computation keeps full floating-point precision.

## Inputs

- Side (s) (0 to 1000000000000); default 5
- Length (l) (0 to 1000000000000); default 5
- Width (w) (0 to 1000000000000); default 3
- Side a (0 to 1000000000000); default 3
- Side b (0 to 1000000000000); default 4
- Side c (0 to 1000000000000); default 5
- Radius (r) (0 to 1000000000000); default 7
- Side a (0 to 1000000000000); default 6
- Side b (0 to 1000000000000); default 4

## Worked examples (computed by the page's own function)

- Side (s) = 5 → Perimeter (P) = 20  (P = 4 × 5 = 20)
- Length (l) = 5, Width (w) = 3 → Perimeter (P) = 16  (P = 2 × (5 + 3) = 16)
- Radius (r) = 7 → Circumference (C) = 43.982297  (C = 2π × 7 = 43.98229715)
- Side a = 3, Side b = 4, Side c = 5 → Perimeter (P) = 12  (P = 3 + 4 + 5 = 12)
- Side a = 6, Side b = 4 → Perimeter (P) = 20  (P = 2 × (6 + 4) = 20)

## Verification

Checked against 18 reference cases (expected values computed independently). Reviewed 2026-10-27. Latest change 2026-10-28: Moved to the schema renderer with a sourced ledger; the shape is picked with buttons instead of a dropdown, results keep 6 decimals instead of 6 significant figures, and an impossible triangle flags its longest side.

## FAQ

**What is perimeter?**
Perimeter is the total distance around the outside edge of a two-dimensional shape. You find it by adding up the lengths of all the sides. For a circle, the equivalent measurement is called the circumference. Perimeter is always a length, measured in units such as centimeters, meters, or inches.

**What is the formula for the perimeter of a rectangle?**
A rectangle's perimeter is P = 2(l + w), where l is the length and w is the width. Add the length and width, then double the result. For example, a rectangle that is 5 by 3 has a perimeter of 2 × (5 + 3) = 16.

**How do I find the perimeter of a circle?**
A circle's perimeter is called its circumference, given by C = 2πr where r is the radius. If you know the diameter d instead, you can use C = πd. For a radius of 7, C = 2 × π × 7 ≈ 43.98. This calculator uses the full-precision value of π.

**What is the difference between perimeter and area?**
Perimeter measures the distance around a shape's boundary and is expressed in linear units like meters. Area measures the flat space enclosed inside the shape and is expressed in square units like square meters. A 4 × 4 square has a perimeter of 16 and an area of 16, but the matching units (16 m versus 16 m²) are different.

**How do I calculate the perimeter of a triangle?**
Add the lengths of all three sides: P = a + b + c. For a triangle with sides 3, 4, and 5, the perimeter is 3 + 4 + 5 = 12. The three lengths must satisfy the triangle inequality — each side shorter than the sum of the other two — to form a real triangle.

**Why does the calculator reject zero or negative values?**
A side length or radius must be positive for a shape to exist. A value of zero or less has no real geometric meaning, so the calculator asks for numbers greater than zero before it computes a perimeter.


## Sources

- [Wikipedia — Perimeter](https://en.wikipedia.org/wiki/Perimeter)
- [Wikipedia — Circumference](https://en.wikipedia.org/wiki/Circumference)
- [Math is Fun — Perimeter](https://www.mathsisfun.com/geometry/perimeter.html)
- [Wikipedia — Triangle inequality](https://en.wikipedia.org/wiki/Triangle_inequality)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Perimeter Calculator", https://hifreetools.com/calculators/perimeter-calculator
