Geometry Calculator
Area and perimeter for flat shapes, volume and surface area for solids. Choose a shape and the inputs change to match it. Triangles are solved from three sides using Heron’s formula, and impossible side lengths are rejected rather than quietly returning a meaningless number.
Choose a shape and enter its dimensions
How to use this calculator
- Pick a shape. The input boxes change to match it, so you are never asked for a dimension the shape does not have.
- Enter the dimensions. Use the same unit throughout — mixing centimetres and metres is the most common source of a wrong answer.
- Optionally type a unit label such as cm. Answers are then labelled cm, cm² or cm³ as appropriate.
The formulas used
Circle — area πr², circumference 2πr.
Rectangle — area w × h, perimeter 2(w + h), diagonal √(w² + h²) by Pythagoras.
Triangle — area by Heron's formula, √(s(s−a)(s−b)(s−c)) where s is the semi-perimeter. This needs only the three sides, no angle and no height.
Trapezoid — area ½(a + b)h, where a and b are the parallel sides.
Sphere — volume ⁴⁄₃πr³, surface area 4πr².
Cylinder — volume πr²h, surface area 2πr(r + h).
Cone — volume ⅓πr²h, slant height √(r² + h²), surface area πr(r + l).
Rectangular prism — volume lwh, surface area 2(lw + lh + wh), space diagonal √(l² + w² + h²).
Why some side lengths are rejected
Three lengths only form a triangle if each one is shorter than the sum of the other two — the triangle inequality. Sides of 1, 2 and 5 cannot meet: the short sides are not long enough to reach across the long one.
Heron's formula does not notice. Fed impossible sides it takes the square root of a negative number and returns "not a number", or worse, a plausible-looking figure. This calculator checks the inequality first and tells you what is wrong, rather than returning something that looks like an answer.
Frequently Asked Questions
How do I calculate the area of a triangle without the height?
Use Heron's formula, which needs only the three side lengths. Work out the semi-perimeter s, half the perimeter, then take the square root of s(s-a)(s-b)(s-c). This calculator does it for you and also reports the height on side a, in case you need it.
What is the difference between surface area and lateral area?
Surface area is the whole outside of a solid. Lateral area is only the curved or slanted side, leaving out the flat ends. For a cylinder the lateral area is 2 pi r h, the label on a tin; the surface area adds the two circular ends.
How do I use the Pythagorean theorem here?
It is built into several results. The diagonal of a rectangle is the square root of w squared plus h squared, the space diagonal of a box extends the same idea to three dimensions, and a cone's slant height is the square root of r squared plus h squared.
Why does it refuse my triangle's side lengths?
Because those three lengths cannot form a triangle. Each side has to be shorter than the sum of the other two, so 1, 2 and 5 is impossible. Rather than return a meaningless number, the calculator says so.
Does the unit box convert between units?
No. It only labels the answers, so entering cm gives you results in cm, cm squared and cm cubed. Enter all your dimensions in the same unit; the calculator cannot tell that one box is metres and another centimetres.
