Perimeter Calculator
Calculate perimeter instantly with our math tool. Shows detailed work, formulas used, and multiple solution methods. Free to use with no signup required.
Calculator
Adjust values & calculateFormula
Each shape has its own perimeter formula. For polygons, add all side lengths. For circles, use the circumference formula with pi. For ellipses, use Ramanujan approximation.
Last reviewed: December 2025
Worked Examples
Example 1: Fencing a Rectangular Yard
Example 2: Running Track Circumference
Background & Theory
The Perimeter Calculator applies the following established principles and formulas. Mathematics rests on a hierarchy of number systems, each extending the previous. The natural numbers (1, 2, 3, ...) support counting and ordering. The integers add negative values and zero, enabling subtraction without restriction. The rational numbers, expressible as p/q where p and q are integers and q is nonzero, close the system under division. The real numbers fill the gaps left by irrationals such as the square root of 2 or pi, forming a complete ordered field. The complex numbers, written as a + bi where i is the square root of negative one, complete the algebraic closure of the reals and allow every polynomial to have a root. Prime factorization states that every integer greater than one is uniquely expressible as a product of primes, a result known as the Fundamental Theorem of Arithmetic. Computing the greatest common divisor (GCD) of two integers relies most efficiently on the Euclidean algorithm: repeatedly replace the larger number with the remainder when it is divided by the smaller, until the remainder is zero. The last nonzero remainder is the GCD. The least common multiple (LCM) follows from the identity LCM(a, b) = |a * b| / GCD(a, b). Modular arithmetic defines equivalence classes of integers that share the same remainder under division by a modulus n. Fermat's Little Theorem and Euler's Theorem arise from this structure and underpin modern cryptography. Logarithms are the inverses of exponential functions. If b raised to the power x equals y, then the logarithm base b of y equals x. The natural logarithm uses base e, approximately 2.71828. Combinatorics counts arrangements and selections. The number of ordered arrangements (permutations) of r objects from n distinct objects is nPr = n! / (n - r)!. The number of unordered selections (combinations) is nCr = n! / (r! * (n - r)!). Pascal's triangle arranges these binomial coefficients so that each entry equals the sum of the two entries directly above it. The Fibonacci sequence, defined by F(1) = 1, F(2) = 1, and F(n) = F(n-1) + F(n-2), appears throughout nature and connects deeply to the golden ratio via Binet's formula.
History
The history behind the Perimeter Calculator traces back through the following developments. Mathematics as a systematic discipline traces to ancient Mesopotamia. Babylonian clay tablets dating to around 1800 BCE demonstrate knowledge of quadratic equations, Pythagorean triples, and base-60 arithmetic, suggesting a practical mathematical tradition far preceding Greek formalism. Euclid of Alexandria compiled the Elements around 300 BCE, establishing the axiomatic method that would define rigorous mathematics for over two thousand years. His work organized plane geometry, number theory, and proportion into logically chained propositions derived from a small set of postulates. The algorithm bearing his name for computing GCDs appears in Book VII and remains in use today. In the 9th century, the Persian scholar Muhammad ibn Musa Al-Khwarizmi wrote Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala, the treatise whose title gave algebra its name. He systematized the solution of linear and quadratic equations and described procedures that operated on unknowns as objects, a conceptual leap away from purely numerical calculation. Rene Descartes introduced coordinate geometry in 1637 by uniting algebra and Euclidean geometry, allowing curves to be studied through equations. This synthesis set the stage for calculus. Isaac Newton and Gottfried Wilhelm Leibniz independently developed calculus during the 1660s and 1670s, triggering a priority dispute that lasted decades and divided British and Continental mathematicians. Carl Friedrich Gauss proved the Fundamental Theorem of Algebra in 1799, showing that every nonconstant polynomial has at least one complex root. His Disquisitiones Arithmeticae of 1801 established modern number theory. David Hilbert's formalist program at the turn of the 20th century sought to place all of mathematics on an explicit axiomatic foundation, a project that Kurt Godel's incompleteness theorems of 1931 showed to be fundamentally limited. Alan Turing's work in the 1930s on computability introduced the theoretical model of the stored-program computer and linked mathematical logic directly to the limits of algorithmic calculation. His proof that no algorithm can decide in general whether an arbitrary program will halt or run forever placed fundamental boundaries on what mathematics can mechanically determine, and it opened the discipline now known as theoretical computer science.
Frequently Asked Questions
Sources & References
Formula
Rectangle: P = 2(l+w) | Circle: C = 2*pi*r | Triangle: P = a+b+c | Regular Polygon: P = ns
Each shape has its own perimeter formula. For polygons, add all side lengths. For circles, use the circumference formula with pi. For ellipses, use Ramanujan approximation.
Worked Examples
Example 1: Fencing a Rectangular Yard
Problem: A homeowner needs fencing for a rectangular yard measuring 25 meters by 18 meters. How much fencing is needed?
Solution: Shape: Rectangle\nLength (a) = 25 m, Width (b) = 18 m\nP = 2(l + w) = 2(25 + 18) = 2 x 43 = 86 m\nArea = 25 x 18 = 450 sq m
Result: Perimeter: 86 meters of fencing needed
Example 2: Running Track Circumference
Problem: A circular running track has a radius of 50 meters. What is the distance of one complete lap?
Solution: Shape: Circle\nRadius = 50 m\nC = 2 x pi x r = 2 x 3.14159 x 50\nC = 314.159 m\nArea = pi x r^2 = 7,853.98 sq m
Result: Circumference: 314.16 meters per lap
Frequently Asked Questions
What is a perimeter and how is it calculated?
The perimeter is the total distance around the outside boundary of a two-dimensional shape. It is calculated by adding up the lengths of all sides of a polygon, or using specific formulas for curved shapes. For a rectangle, the perimeter equals two times the sum of length and width: P = 2(l + w). For a square, it simplifies to P = 4s since all sides are equal. For a triangle, you simply add all three sides: P = a + b + c. For a circle, the perimeter is called the circumference and is calculated as C = 2 times pi times the radius. Understanding perimeter is fundamental in mathematics and has practical applications in fencing, framing, border installation, running track measurements, and many construction and landscaping projects.
What is the difference between perimeter and area?
Perimeter and area are both measurements of two-dimensional shapes but they measure fundamentally different properties. Perimeter measures the total length of the boundary or outline of a shape and is expressed in linear units like meters, feet, or centimeters. Area measures the total space enclosed within the boundary of a shape and is expressed in square units like square meters, square feet, or square centimeters. Two shapes can have the same perimeter but very different areas, and vice versa. For example, a 10x1 rectangle and a 4x7 rectangle both have a perimeter of 22 units, but their areas are 10 and 28 square units respectively. This distinction is important in real-world applications: you need perimeter to calculate fencing material but area to calculate flooring material.
How do you calculate the perimeter of irregular shapes?
Calculating the perimeter of irregular shapes requires measuring each side individually and summing all the lengths. For polygonal irregular shapes with straight sides, simply measure each side with a ruler, tape measure, or coordinate geometry and add them together. For shapes with curved boundaries, you can approximate the perimeter by dividing the curve into small straight segments and summing their lengths, a method related to calculus concepts. In coordinate geometry, if you know the vertices of an irregular polygon, use the distance formula between consecutive points: d = sqrt((x2-x1)squared + (y2-y1)squared). For practical applications like measuring an irregular garden plot, you can use a flexible measuring tape along the boundary, a measuring wheel, or GPS-based measurement tools that track the path around the perimeter.
What is the perimeter formula for a regular polygon?
A regular polygon has all sides of equal length and all interior angles equal. The perimeter formula is simply P = n times s, where n is the number of sides and s is the length of each side. This works because every side is identical. For common regular polygons: an equilateral triangle (n=3) has P = 3s, a square (n=4) has P = 4s, a regular pentagon (n=5) has P = 5s, a regular hexagon (n=6) has P = 6s, and so on. If you know the apothem (distance from center to midpoint of a side) instead of the side length, you can calculate the side length using s = 2 x apothem x tan(pi/n). As the number of sides increases, a regular polygon approaches a circle, and its perimeter approaches the circumference formula 2 times pi times r.
How is the perimeter of an ellipse calculated?
Unlike the circle which has the simple circumference formula C = 2 times pi times r, there is no exact closed-form formula for the perimeter of an ellipse using elementary functions. The exact perimeter requires evaluating an elliptic integral, which involves advanced calculus. However, several excellent approximations exist for practical use. The most commonly used is Ramanujan's approximation: P is approximately equal to pi times (3(a+b) minus the square root of (3a+b)(a+3b)), where a and b are the semi-major and semi-minor axes. This formula is accurate to within 0.04% for most ellipses encountered in practical applications. Another simpler but less accurate approximation is P approximately equals pi times the square root of 2(a squared + b squared). For highly eccentric ellipses, more precise infinite series expansions are available.
What are some real-world applications of perimeter calculations?
Perimeter calculations are essential in many practical situations. In construction, you need the perimeter to determine how much fencing, baseboard, crown molding, or weatherstripping to purchase. Landscapers use perimeter to calculate the amount of edging material for garden beds and walkways. Architects calculate building perimeters for exterior cladding and gutter estimates. In sports, track perimeters determine race distances. Farmers use field perimeters for fence planning and irrigation border design. Even in everyday tasks like framing a picture or sewing a hem, perimeter is the key measurement needed.
References
Reviewed by Manoj Kumar, Mathematics Educator ยท Editorial policy