Area and perimeter

Calculate area and perimeter for rectangle, circle, and right triangle.

{{ geometryCalc.message }}

Overview

The plane geometry this tool applies has nearly 2,500 years of continuous history. Euclid of Alexandria systematized area and perimeter formulas around 300 BC in the Elements, a 13-book work that remained the primary mathematics textbook in the Western world until the 19th century — longer than any other scientific book, rivaled only by the Bible in number of editions. But the most elegant formula here is the one for a circle: A = π × r², a result that took centuries to prove rigorously. Archimedes of Syracuse, in the 3rd century BC, inscribed and circumscribed regular polygons in a circle to approximate π between 3 + 10/71 and 3 + 1/7, achieving precision within 0.002%. The circumference C = 2πr and the area A = πr² are direct consequences of that work.

One thing that confuses students is that area and perimeter have completely different physical dimensions — and this matters greatly in practice. Perimeter is length: measured in meters, centimeters, feet. Area is surface: measured in m², cm², ft². If you double the dimensions of a rectangle, the perimeter doubles but the area quadruples. That non-linear relationship is why a small ice cube melts faster than a large one (greater surface-to-volume ratio), why insects can exist at microscopic scale but large animals need complex lungs, and why tall buildings need more elevators per floor than short ones. The Pythagorean theorem, used here to calculate the hypotenuse of a right triangle, was proven by Euclid in Book I of the Elements as Proposition 47 — even though Babylonian civilizations already knew the 3-4-5 triple at least 1,000 years before Pythagoras was born.

In computing, area and perimeter appear constantly in forms we do not always recognize: the CSS box model uses rectangle widths and heights to calculate layout. The CSS `border-radius` property creates arcs of circumference. Game engines like Unity and Unreal calculate colliders as polygons and circles for collision detection. Map APIs like Google Maps and Leaflet calculate areas of geographic polygons using formulas derived from Gauss. Image processing in OpenCV uses `contourArea()` and `arcLength()` — exactly the area and perimeter of detected shapes. In architecture and civil engineering, calculating the area of slabs, roofs, and lots is the most basic operation before any estimate. This tool covers the three most common shapes: rectangle, circle, and right triangle.

Technical deep dive

Common questions summarized

  • What is this tool for?: It runs fully in your browser: useful to validate, format, or convert data in everyday development.
  • Are my inputs sent to a server?: Processing happens locally with JavaScript. We do not store what you paste into the text areas.
  • Can I use this for real production data?: Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.

Sample payload to try

  • See also the larger "Code Snippets" sample; paste this excerpt to try locally: Example — Retângulo 10 x 5 Área: 50 Perímetro: 30

Code Snippets

Code example
Retângulo 10 x 5
Área: 50
Perímetro: 30

Example

Retângulo 10 x 5
Área: 50
Perímetro: 30

FAQ

What is this tool for?

It runs fully in your browser: useful to validate, format, or convert data in everyday development.

Are my inputs sent to a server?

Processing happens locally with JavaScript. We do not store what you paste into the text areas.

Can I use this for real production data?

Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.