2D Shapes Calculator
Results
Formulas Used in 2D Shapes Calculator
In-Depth Tutorial: 2D Shapes Calculator
The 2D Shapes Calculator handles the six most common two-dimensional figures — square, rectangle, triangle, circle, parallelogram, and trapezoid — in a single tool. Pick the shape, enter the required dimensions, and the calculator returns both area and perimeter. This tutorial covers what dimensions each shape needs, the formulas behind the calculations, and how to choose between specialized calculators when you need more depth.
The six shapes at a glance
| Shape | Inputs needed | Area formula | Perimeter formula |
|---|---|---|---|
| Square | side length s | s² | 4s |
| Rectangle | length l, width w | l × w | 2(l + w) |
| Triangle | base b, height h | ½ × b × h | varies (need all 3 sides) |
| Circle | radius r | πr² | 2πr (circumference) |
| Parallelogram | base b, height h | b × h | varies (need both side lengths) |
| Trapezoid | two bases b₁, b₂, height h | ½(b₁ + b₂) × h | varies (need all 4 sides) |
Square — the simplest case
A square has four equal sides and four right angles. Its area and perimeter both depend on a single input: the side length s.
Area = s². Perimeter = 4s.
Example: a square with s = 6 cm has area 36 cm² and perimeter 24 cm.
Rectangle
A rectangle has two pairs of parallel sides with opposite sides equal. Four right angles.
Area = length × width = l × w. Perimeter = 2(l + w).
Example: a rectangle 8 m × 5 m has area 40 m² and perimeter 26 m.
Triangle
The triangle formula A = ½ × base × height applies to any triangle, not just right ones. The height is the perpendicular distance from the chosen base to the opposite vertex.
If you have all three sides but no height, use Heron's formula instead: A = √(s(s−a)(s−b)(s−c)) where s = (a+b+c)/2.
For the full triangle solver (any inputs, any case), use the Triangle Solver.
Example: a triangle with base 10 cm and height 6 cm has area 30 cm². Perimeter depends on the other two sides.
Circle
A circle is fully determined by its radius (distance from center to edge).
Area = πr². Perimeter (called "circumference") = 2πr.
Note the irrational number π ≈ 3.14159. The full π discussion is worth a read.
For more circle subtopics (sector area, arc length, chord length), use the Circle Geometry Calculator.
Example: a circle with r = 4 cm has area 16π ≈ 50.27 cm² and circumference 8π ≈ 25.13 cm.
Parallelogram
A parallelogram has two pairs of parallel sides but its angles are generally not 90° (a parallelogram with right angles IS a rectangle — a special case).
Area = base × height. The height is the perpendicular distance between the two chosen parallel sides, NOT the length of the slanted side.
Perimeter = 2(base + side length). Note: the "side length" is the slanted side, not the height.
Example: a parallelogram with base 8 and height 5 (and slant side 6) has area 40 and perimeter 28.
For more parallelogram-specific tools (angles, diagonals, height from sides), see the Parallelogram Angle Solver and related parallelogram calculators.
Trapezoid
A trapezoid has at least one pair of parallel sides. Its area formula averages the two parallel sides and multiplies by the perpendicular height.
Area = ½ × (b₁ + b₂) × h. Perimeter = sum of all four sides.
For the full derivation and worked examples, see the trapezoid area tutorial.
Example: a trapezoid with parallel sides 6 and 10, and height 4, has area ½ × 16 × 4 = 32.
Choosing between this calculator and specialized ones
The 2D Shapes Calculator is a quick general-purpose tool. For deeper analysis on any specific shape, our specialized calculators have more inputs and outputs:
- Triangle Solver — any triangle from any 3 known elements (SSS, SAS, ASA, AAS, SSA)
- Circle Geometry Calculator — radius, diameter, area, circumference interconnected; reverse-direction solving
- Quadrilateral Angle Calculator — all four angles given three
- Polygon Angle Sum — for any n-sided polygon
- Regular Polygon Calculator — areas and perimeters of n-sided regular polygons
What counts as a "2D shape"?
The six shapes in this calculator are the most common, but countless other 2D shapes exist:
- Regular polygons (pentagon, hexagon, octagon, etc.) — handled by the polygon calculators.
- Irregular polygons — area found by decomposing into triangles or using the Shoelace formula. See Area of Any Polygon.
- Ellipses — A = πab where a and b are the semi-major and semi-minor axes. Perimeter has no closed-form formula; an approximation is π(a + b)(1 + 3h/(10 + √(4−3h))) where h = ((a−b)/(a+b))².
- Sectors and circular segments — see the Circle Geometry Calculator and related circle tools.
- Composite figures — shapes built from multiple primitive shapes. Use the Composite Figure Calculator or AI Solve for irregular composites.
Worked example — comparing areas at fixed perimeter
You have 24 cm of fencing. What shape gives the maximum area?
- Square: perimeter 24 → side 6 → area 36 cm².
- Rectangle 8×4: same perimeter, area 32. Smaller.
- Rectangle 10×2: perimeter 24, area 20. Smaller still.
- Equilateral triangle with side 8: perimeter 24, area = (√3/4)(8)² = 16√3 ≈ 27.7 cm². Smaller.
- Circle with circumference 24: radius = 24/(2π) ≈ 3.82 → area = π(3.82)² ≈ 45.8 cm². Largest of all!
Among all 2D shapes with a given perimeter, the circle always encloses the maximum area. This is called the isoperimetric inequality and is a foundational result in geometry.
Common mistakes
- Using slant side as height in parallelogram or trapezoid. Height is the perpendicular distance between the parallel sides, NOT the slanted side. Only in a rectangle (or right trapezoid leg) are they the same.
- Using diameter as radius for the circle. Halve the diameter first.
- Confusing area and perimeter units. Area is in squared units (cm², m², etc.). Perimeter is in linear units (cm, m, etc.). A "perimeter of 100 cm²" doesn't make sense.
- Forgetting the ½ for triangle area. Area = ½ × base × height. Without the ½ you get the area of the bounding rectangle.
- Plugging diagonal of a rectangle as a side. The diagonal is √(l² + w²) by the Pythagorean theorem. It is not an input to the area formula.
Frequently Asked Questions – 2D Shapes Calculator
Square, rectangle, triangle, circle, parallelogram, and trapezoid. Select the shape first — the required dimension fields update accordingly.
It depends on the shape. For rectangle: length and width. For triangle: base and height. For parallelogram: base and height. For circle: enter radius in Dimension 1.
Yes — the calculator returns both area and perimeter for all supported shapes in a single result.
Yes — completely free and unlimited.
Queen Dido and the oldest optimization problem in geometry
The tutorial above mentions that the circle encloses maximum area for any given perimeter. This result — the isoperimetric inequality — is one of the oldest optimization problems in mathematics, dating back to a founding legend of the Phoenician city of Carthage.
According to Virgil's Aeneid, Queen Dido fled Tyre and arrived on the North African coast around 814 BCE seeking to found a new city. The local ruler offered her as much land "as could be enclosed by an ox-hide." A single ox-hide sounds trivially small, but Dido reportedly had the hide cut into extremely thin strips, tied end-to-end into a very long strip. She then arranged the strip along a semicircular arc against the coast — the coast served as the diameter, and the strip formed the curved boundary. This maximized the enclosed area given the fixed strip length, and the enclosed territory became the site of Carthage.
The geometric problem — "given a fixed perimeter, what shape encloses the maximum area?" — is now called Dido's problem in her honor. The answer is unambiguous: a circle. For a boundary of length P, the circle's enclosed area is P²/(4π) ≈ P²/12.57, larger than any other shape with the same perimeter. Rigorous proof of this result took until the 19th century, though the intuition was clear to Greek mathematicians thousands of years earlier.
Concrete illustration of the tutorial's example: for a fixed perimeter of 24 cm, a square encloses 36 cm², an equilateral triangle 27.7 cm², a 10×2 rectangle only 20 cm², but a circle encloses 24²/(4π) ≈ 45.8 cm² — the circle wins by more than 25% over the next-best regular polygon. This is why bubbles, planetary orbits, coffee stains, and countless other physical shapes tend toward circular boundaries: the circle minimizes some cost (surface tension energy, gravitational potential, etc.) that scales with perimeter for a fixed enclosed quantity.
The ellipse's perimeter is a genuine mathematical curiosity
The tutorial mentions in passing that an ellipse's perimeter has no closed-form formula. This is worth pausing on because it's genuinely unusual — most standard 2D shapes have simple perimeter formulas. Every regular polygon has perimeter n × side. The circle has 2πr. The ellipse breaks the pattern.
Given semi-axes a (longer) and b (shorter), the exact ellipse perimeter is a complete elliptic integral of the second kind, which doesn't have an expression in terms of elementary functions like square roots, sines, or logarithms. It can be computed numerically to arbitrary precision but cannot be written down in closed form. Approximations are used instead.
The tutorial gives one approximation. A much better one, credited to Srinivasa Ramanujan in 1914, is:
P ≈ π(a + b)(1 + 3h/(10 + √(4 − 3h))), where h = ((a − b)/(a + b))²
For an ellipse with a = 5 and b = 3, Ramanujan's formula gives about 25.5265, accurate to about 8 significant digits. The simpler formula P ≈ π(a + b) gives 25.13, accurate to only 3 significant digits — a substantial gap. For circular shapes (a = b), all approximations reduce to 2πa exactly, so accuracy only becomes an issue for elongated ellipses.
Practical significance: satellite orbits are elliptical, and computing orbital periods, distances traveled, or fuel budgets requires elliptical perimeter estimates. Ramanujan's approximation is standard in astrodynamics software because it's fast, accurate, and requires no iteration. Every satellite mission, every orbital-mechanics simulation implicitly relies on the fact that we can't compute an ellipse's perimeter exactly in closed form but can approximate it to whatever accuracy the application needs.
2D calculation questions worth answering
If a floor is 12 ft × 15 ft, how many 12" × 12" tiles do I need, and how much do I buy?
Area of floor: 12 × 15 = 180 sq ft. Each tile is 1 × 1 = 1 sq ft, so nominally 180 tiles cover the floor exactly. In practice, buy 10-15% more to account for waste from cuts at edges, breakage, and future repairs — so about 180 × 1.10 = 198 tiles, or 180 × 1.15 = 207 tiles. Contractors round up to full boxes (usually 10 tiles per box), so you'd buy 21 boxes (210 tiles) for a standard 15% overage. If the floor has a complex shape (L-shaped rooms, cutouts for hearths or built-ins), estimate area for each rectangular section separately and sum — this is the "composite figure" approach the calculator's related tools handle.
If two similar rectangles have side lengths in ratio 2:5, what's the ratio of their areas?
4:25 — the ratio of areas is the ratio of sides squared. This is one of the most common mistakes in geometry: assuming areas scale linearly with size. Doubling every linear dimension quadruples the area (2² = 4), tripling multiplies area by nine (3² = 9). The rule applies to any pair of similar shapes: Area₂/Area₁ = (Length₂/Length₁)². In 3D, volumes scale as the cube: Volume₂/Volume₁ = (Length₂/Length₁)³. This "squares and cubes law" underlies why elephants can't be shrew-sized (surface-to-volume scaling makes them freeze) and why architectural models made to different scales handle wind loading differently. When you use the 2D calculator on similar shapes, verify by checking that the area ratio equals the length ratio squared.
How can I use dimensional analysis to catch mistakes?
Every geometric quantity has a dimension: length (meters), area (m²), volume (m³), angle (dimensionless). Formulas must be dimensionally consistent — the units on both sides of an equation must match. If you compute an "area" and get an answer in cm rather than cm², you know there's an error. If a "perimeter" comes out in cm² rather than cm, same. This works in the other direction too: seeing Area = base × height tells you both inputs must be lengths, and the output is length × length = length² = area. Consistent. But Area = base + height would be dimensionally suspect — you can't add lengths and expect an area. Dimensional analysis catches most arithmetic errors within seconds of writing the formula, and it's the first check any physicist or engineer performs. Every result the calculator returns has correct dimensions by design; if you type units into the input fields and they don't match, that's a sign to double-check what you meant.
What counts as a "diagonal" versus a "side" for polygon calculations?
A side is a boundary edge — a straight segment of the polygon's perimeter. A diagonal is any straight segment connecting two non-adjacent vertices, passing through the polygon's interior. Every polygon has n sides (equal to its vertex count). It has n(n − 3)/2 diagonals: 0 diagonals in a triangle, 2 in a quadrilateral, 5 in a pentagon, 9 in a hexagon, 14 in a heptagon. For calculators expecting side inputs, entering a diagonal instead gives wrong answers. Rectangle "sides" are l and w; rectangle "diagonal" is √(l² + w²). If a problem states "the rectangle has a diagonal of 13", you can't plug 13 into a side field — you have to first work out which side values are consistent with that diagonal length (which requires additional information, since infinitely many rectangles have any given diagonal length).