Ellipse Calculator
Enter the long and short half-axes to get the area, the exact perimeter, the eccentricity and the foci, with a drawing. Advanced solves from area, perimeter or eccentricity and adds the equation and more.
Mix units if you like (a in m, b in cm). If b is the bigger one, the calculator swaps them.
Step-by-step working
How your ellipse is worked out
An ellipse is a stretched circle: the long half a and the short half b give everything else.
- 1
Space inside
π × 5 × 3
A = 47.1239 cm² - 2
How stretched
√(1 − 3²÷5²)
e = 0.8 - 3
Find the foci
c = √(5² − 3²)
c = 4 cm - 4
Round the edge
AGM, 4 rounds
P = 25.527 cm
Read more: the formulas, a worked example, the AGM perimeter and string-and-nails layout
An ellipse is a squashed circle. Its longest half-width, from the centre to the far edge, is the semi-major axis a; its shortest is the semi-minor axis b. Two special points on the long axis, the foci, sit a distance c from the centre. From any point on the edge, the distances to the two foci always add up to 2a, which is why the string-and-nails trick works.
The formula
area A = π × a × b
eccentricity e = √(1 − b² ÷ a²) = c ÷ a
focal distance c = √(a² − b²)
foci at (h − c, k) and (h + c, k)
exact perimeter P = 2π ÷ M(a, b) × (a² − Σ 2ⁿ⁻¹ × cₙ²)
where M is the AGM of a and b, c₀² = a² − b², cₙ₊₁ = (aₙ − bₙ) ÷ 2
Ramanujan: P ≈ π × (a + b) × (1 + 3h ÷ (10 + √(4 − 3h))), h = (a − b)² ÷ (a + b)²
latus rectum = 2 × b² ÷ a
directrices at x = h ± a ÷ e
flattening f = (a − b) ÷ a
equation (x − h)² ÷ a² + (y − k)² ÷ b² = 1
Worked example
The default ellipse has a = 5 cm and b = 3 cm (10 cm long, 6 cm wide).
- Area: π × 5 × 3 = 15π cm² ≈ 47.1239 cm².
- Eccentricity: √(1 − 3² ÷ 5²) = √(1 − 9/25) = √(16/25) = 0.8.
- Foci: c = √(5² − 3²) = √(25 − 9) = √16 = 4 cm, so the foci are at (−4, 0) and (4, 0).
- Ramanujan: h = (5 − 3)² ÷ (5 + 3)² = 4/64 = 0.0625. Then 3h = 0.1875 and √(4 − 0.1875) = √3.8125 = 1.952562, so P ≈ π × 8 × (1 + 0.1875 ÷ 11.952562) = 25.132741 × 1.015687 = 25.526999 cm.
- Exact (AGM): start with a₀ = 5, b₀ = 3 and c₀² = 25 − 9 = 16, so the sum starts at 16 ÷ 2 = 8. Round 1: c₁ = (5 − 3) ÷ 2 = 1, a₁ = (5 + 3) ÷ 2 = 4, b₁ = √(5 × 3) = 3.872983; add 1 × 1² = 1, sum 9. Round 2: c₂ = (4 − 3.872983) ÷ 2 = 0.063508; add 2 × 0.063508² = 0.008067, sum 9.008067. Round 3 adds only 0.00000026, and the means meet at M = 3.936236. So P = 2π ÷ 3.936236 × (25 − 9.008067) = 1.596242 × 15.991933 = 25.526999 cm (25.5269988634 cm). Ramanujan’s answer is smaller by just 0.0000000006 cm.
- Extras: latus rectum 2 × 9 ÷ 5 = 3.6 cm; directrices at x = ±5 ÷ 0.8 = ±6.25 cm; flattening (5 − 3) ÷ 5 = 0.4; equation x²/25 + y²/9 = 1.
- String and nails: nails 2 × 4 = 8 cm apart, string 2 × 5 = 10 cm between the nails (or an 18 cm loop).
Why the perimeter is hard
Area has the neat formula πab, but the distance round an ellipse does not: it is 4a × E(e), where E is the complete elliptic integral of the second kind. The arithmetic–geometric mean method (Gauss, and later Legendre) gets it to full computer accuracy in about four rounds for ordinary shapes, so the “exact” value here is good to around 15 significant figures. Ramanujan’s 1914 approximations are excellent for most shapes; the rough school formula 2π√((a² + b²) ÷ 2) is several percent out for flat ellipses.
Solving backwards
- Area and one axis: b = A ÷ (π × a).
- Axis and eccentricity: b = a × √(1 − e²).
- Axis and focal distance: b = √(a² − c²).
- Perimeter and one axis: no formula, so the calculator searches (bisection) for the other axis that gives your perimeter.
- Perimeter and shape (b ÷ a): perimeter grows in step with size, so a = P ÷ (perimeter of an ellipse with a = 1 and the same shape).
Drawing an ellipse in a garden or on a table top
Mark the long centre line and the centre. Put a nail (or peg) on the line c either side of the centre. Tie a non-stretchy string to both nails so that 2a of string runs between them, pull it tight with a pencil or a sharp stick and walk round, keeping it tight. If you prefer a closed loop round both nails and the pencil, make the loop 2a + 2c long. Check the result: it should be 2a long and 2b wide.
Elliptical tanks
For a tank lying on its side, the liquid’s cross-section is the piece of the ellipse below the liquid line. Choose “Tank fill depth from the bottom” and multiply the area by the tank’s length for the volume. 1 litre is 1,000 cm³ and 1 m³ is 1,000 litres.
π used here is JavaScript’s built-in value, 3.141592653589793. For round shapes use the circle calculator; for other flat shapes try the area calculator.
Common questions
How do I find the area of an ellipse?
Multiply π by the two half-axes: A = π × a × b. An ellipse 10 cm long and 6 cm wide has a = 5 and b = 3, so the area is π × 5 × 3 = 15π, about 47.12 cm². A circle is the special case where a = b = r, giving π × r².
Is there an exact formula for the perimeter of an ellipse?
There is no simple closed formula. The exact value is an elliptic integral, which this calculator works out with the arithmetic–geometric mean (AGM) method to full accuracy in a few rounds. For a = 5 and b = 3 it is 25.52700. Ramanujan’s second approximation gives 25.52700 too: the two differ by less than a billionth here.
How accurate is Ramanujan’s approximation?
Very. For everyday shapes it is right to about nine decimal places, and even for a long thin ellipse (a = 10, b = 1) it is off by only about 0.0000002%. The calculator shows both values and the difference, so you can see it for your own ellipse.
What is eccentricity?
Eccentricity e says how stretched an ellipse is: e = √(1 − b² ÷ a²). 0 is a perfect circle and values close to 1 are long and thin. For a = 5 and b = 3, e = √(1 − 9/25) = 0.8. It is also the focal distance divided by a: e = c ÷ a.
Where are the foci of an ellipse?
On the long axis, a distance c = √(a² − b²) either side of the centre. For a = 5 and b = 3, c = 4, so the foci are at (−4, 0) and (4, 0). From any point on the ellipse, the distances to the two foci always add up to 2a.
How do I draw an ellipse with string and two nails?
Knock in two nails 2c apart on the long centre line, tie a string to both nails with exactly 2a of string between them, pull it tight with a pencil and go round. For a 10 × 6 ellipse the nails are 8 apart and the string is 10 long (or an 18-long loop round both nails and the pencil). Switch to Advanced for your sizes.
Related calculators
Made by Zulu Calculator, part of AlphaZulu LLC. Formulas are shown in full and rule figures are checked against official sources; see how we build calculators.