Skip to content
CalculatorAtlas

Perimeter Calculator

Tested

Perimeter of common shapes.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

Perimeter is the distance around a shape: rectangle 2(a + b), triangle a + b + c, circle 2πr, regular polygon n·a and ellipse via an approximation. A 5 × 3 rectangle has a perimeter of 16.

Choose a shape and enter its dimensions. The calculator returns the perimeter.

Related tools: Circle Perimeter Calculator: Perimeter (circumference) of a circle from its radius. Triangle Perimeter Calculator: Perimeter of a triangle from three sides. Area Calculator: Area of common two-dimensional shapes.

How to use the Perimeter Calculator

  1. Choose shape: Rectangle (a, b), Square (a), Triangle (a, b, c), Circle circumference (radius a), Regular polygon (side a, n sides) and Ellipse (semi-axes a, b).
  2. Enter a (above 0).
  3. Optionally, enter b (above 0).
  4. Optionally, enter c (above 0).
  5. Optionally, enter n (sides) (a whole number, 3 or more).
  6. Press Calculate to see the result, and use Reset to start again.
Inputs of the Perimeter Calculator
InputWhat to enterAllowed values
ShapeChoose one: Rectangle (a, b); Square (a); Triangle (a, b, c); Circle circumference (radius a); Regular polygon (side a, n sides); Ellipse (semi-axes a, b)Starts at Rectangle (a, b)
aA number> 0
b (optional)A number> 0
c (optional)A number> 0
n (sides) (optional)A whole number≥ 3

Formula and method

Formula

rectangle 2(a+b); triangle a+b+c; circle 2πr; polygon n·a; ellipse ≈ π(a+b)(1 + 3h/(10+√(4−3h))), h = ((a−b)/(a+b))²

IEEE-754 double precision; shown to the decimals indicated.

The ellipse uses Ramanujan's second approximation, accurate to about 10⁻⁵ relative error for ordinary ellipses.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Shape = Rectangle (a, b); a = 5; b = 3.

Results of example 1
ResultValue
Perimeter16

Example 2

Inputs: Shape = Triangle (a, b, c); a = 3; b = 4; c = 5.

Results of example 2
ResultValue
Perimeter12

Example 3

Inputs: Shape = Circle circumference (radius a); a = 2.

Results of example 3
ResultValue
Perimeter12.566371

The first line is the headline result (perimeter). IEEE-754 double precision; shown to the decimals indicated.

Per shape

Rectangle: 2 × (5 + 3) = 16. Triangle: sum of the three sides, which must satisfy the triangle inequality. Regular hexagon with side 4: 24. Circle with r = 2: 12.566.

Practical uses

Perimeter tells you how much fencing, trim or edging you need. Area measures the surface inside. Two shapes with the same perimeter can have very different areas.

How the result changes with a

Holding every other input at the first worked example, this table changes only a. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with a
aPerimeter
2.511
516
1026
2046

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • b: left empty shows "Enter this value." beside that field and no result.
  • c: entering "5" shows "These sides cannot form a triangle." beside that field and no result.

Choosing between the Perimeter Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Perimeter Calculator and similar calculators
CalculatorYou enterIt returns
[Circle Perimeter Calculator](/math/circle-perimeter/)radiusCircle Perimeter
[Triangle Perimeter Calculator](/math/triangle-perimeter-calculator/)side a, side b and side cPerimeter
[Area Calculator](/math/area-calculator/)shape and aArea
[Right Triangle Calculator](/math/right-triangle-calculator/)leg a and leg bHypotenuse c
[Pythagorean Theorem Calculator](/math/pythagorean-theorem-calculator/)find, leg a and other sideHypotenuse c

Background: geometry measurements

Geometry results carry units that depend on the quantity: a perimeter or length is in linear units such as cm, an area or surface area is in square units (cm²) and a volume is in cubic units (cm³). Use one length unit for every input, because the calculator multiplies the numbers as given.

Flat (2D) shapes have an area and a perimeter; solids (3D) have a surface area and a volume. Two familiar checks: a circle of radius r has area πr² and circumference 2πr, and a sphere has volume (4/3)πr³ and surface area 4πr².

Assumptions and limitations

  • Triangle sides must satisfy the triangle inequality

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for b and c to confirm this.

Frequently asked questions

What is the perimeter of a square with side 6?

A square with side 6 has a perimeter of 4 × 6 = 24.

Is circumference the same?

It is the perimeter of a circle.

How is perimeter measured?

Perimeter is a length, measured in units like centimetres or feet, not square units.

What does the Perimeter Calculator calculate?

Perimeter of common shapes. It returns Perimeter.

What formula does the Perimeter Calculator use?

rectangle 2(a+b); triangle a+b+c; circle 2πr; polygon n·a; ellipse ≈ π(a+b)(1 + 3h/(10+√(4−3h))), h = ((a−b)/(a+b))². The ellipse uses Ramanujan's second approximation, accurate to about 10⁻⁵ relative error for ordinary ellipses.

What do I need to enter in the perimeter Calculator?

You enter Shape and a. Optional: b, c and n (sides).

How is the result rounded or limited?

IEEE-754 double precision; shown to the decimals indicated. Triangle sides must satisfy the triangle inequality.

What does the “Shape” option change?

It sets how the perimeter is worked out. The choices are Rectangle (a, b), Square (a), Triangle (a, b, c), Circle circumference (radius a), Regular polygon (side a, n sides) and Ellipse (semi-axes a, b).

What is an example of a perimeter result?

With shape Rectangle (a, b), a 5 and b 3, the perimeter is 16.

Where does the method come from?

The method follows: Ramanujan S, Modular equations and approximations to π (1914).

Sources

  • Ramanujan S, Modular equations and approximations to π (1914)

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.