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
- 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).
- Enter a (above 0).
- Optionally, enter b (above 0).
- Optionally, enter c (above 0).
- Optionally, enter n (sides) (a whole number, 3 or more).
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Shape | Choose 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) |
| a | A 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.
| Result | Value |
|---|---|
| Perimeter | 16 |
Example 2
Inputs: Shape = Triangle (a, b, c); a = 3; b = 4; c = 5.
| Result | Value |
|---|---|
| Perimeter | 12 |
Example 3
Inputs: Shape = Circle circumference (radius a); a = 2.
| Result | Value |
|---|---|
| Perimeter | 12.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.
| a | Perimeter |
|---|---|
| 2.5 | 11 |
| 5 | 16 |
| 10 | 26 |
| 20 | 46 |
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.
| Calculator | You enter | It returns |
|---|---|---|
| [Circle Perimeter Calculator](/math/circle-perimeter/) | radius | Circle Perimeter |
| [Triangle Perimeter Calculator](/math/triangle-perimeter-calculator/) | side a, side b and side c | Perimeter |
| [Area Calculator](/math/area-calculator/) | shape and a | Area |
| [Right Triangle Calculator](/math/right-triangle-calculator/) | leg a and leg b | Hypotenuse c |
| [Pythagorean Theorem Calculator](/math/pythagorean-theorem-calculator/) | find, leg a and other side | Hypotenuse 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).
Related calculators
- 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.
- Right Triangle Calculator — Solve a right triangle from its two legs: hypotenuse, angles, area and perimeter.
- Pythagorean Theorem Calculator — Find the hypotenuse or a missing leg of a right triangle.
- Triangle Calculator — Area, perimeter, angles and type of a triangle from its three sides.
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.