Brahmagupta's Formula Calculator

Find the area of a cyclic quadrilateral from four side lengths, plus its diagonals, perimeter and circumcircle radius.

Math and PercentUpdated 2026-11-183 min read
Brahmagupta's Formula Calculator
Enter the four sides in order around the circle: a, b, c, d.
Area of the cyclic quadrilateral
...
Semiperimeter...
Perimeter...
Diagonal p...
Diagonal q...
Circumcircle radius...

What it does

Brahmagupta's formula computes the area of a quadrilateral whose four vertices all lie on one circle. Give it the four side lengths in order and it returns a single area, with no angles, heights or diagonals needed. The MIT cyclic quadrilaterals handout states the result directly: for sides a, b, c, d and semiperimeter s, the area is the square root of (s - a)(s - b)(s - c)(s - d).

The mathematician Brahmagupta published this result in the seventh century, extending the earlier triangle area result known as Heron's formula. A triangle can be viewed as a quadrilateral with one side shrunk to zero, and at that limit Brahmagupta's expression becomes Heron's expression. The Rutgers paper on Brahmagupta quadrilaterals describes how he used right triangles to build cyclic quadrilaterals with whole number sides, diagonals and area.

The catch is the word cyclic. Four side lengths can be arranged into many quadrilaterals with different areas, but exactly one of them, up to reflection, can be inscribed in a circle. That cyclic arrangement is the one with the largest area for those sides. If your quadrilateral is not cyclic, the formula returns an area that is too large.

This page also returns the semiperimeter, the perimeter, both diagonals and the radius of the circumcircle. The diagonals come from relations published alongside Brahmagupta's area result, and the radius follows from the product of three sums of opposite side pairs. Ptolemy's theorem offers a quick check: the product of the two diagonals equals ac + bd.

The tool takes four positive lengths in any consistent unit. It rejects a set of sides when one is longer than the other three together, because such a quadrilateral cannot close. Areas come out in squared units and every linear result uses the unit you entered for the sides.

How to use

  1. Enter the four side lengths in order around the circle, using side a as any starting edge.
  2. Keep all four lengths in the same unit, such as centimetres or inches.
  3. Read the main result as the area in squared units of the cyclic quadrilateral.
  4. Use the semiperimeter and perimeter to check the arithmetic of your side sum.
  5. Compare the two diagonals. They match only for shapes such as a rectangle, so unequal values are normal.
  6. Use the circumcircle radius when you need the size of the circle through all four corners.

Formula

K = sqrt((s - a)(s - b)(s - c)(s - d)), with s = (a + b + c + d)/2 for sides a, b, c, d in any one length unit.
K
Area of the cyclic quadrilateral, in squared length units.
s
Semiperimeter, half the sum of the four sides, in length units.
a
First side length, in length units.
b
Second side length, taken next around the circle.
c
Third side length, opposite side a.
d
Fourth side length, opposite side b.

The diagonals shown are p = sqrt((ac + bd)(ad + bc)/(ab + cd)) and q = sqrt((ac + bd)(ab + cd)/(ad + bc)), so their product equals ac + bd as Ptolemy's theorem requires. The circumradius is sqrt((ab + cd)(ac + bd)(ad + bc))/(4K). All four sides must use one unit. The formula assumes the quadrilateral is cyclic; the more general Bretschneider formula subtracts abcd times the square of the cosine of half the sum of two opposite angles, a term that vanishes at 180 degrees.

Worked example

Example: Brahmagupta's whole number quadrilateral

Defaults: sides a = 52, b = 25, c = 39 and d = 60, the original example studied by Brahmagupta.

  1. Enter the sides in order: a = 52, b = 25, c = 39, d = 60.
  2. Semiperimeter: s = (52 + 25 + 39 + 60)/2 = 176/2 = 88 units.
  3. Radicand: (88 - 52)(88 - 25)(88 - 39)(88 - 60) = 36 x 49 x 63 x 28 = 3,111,696.
  4. Area: sqrt(3,111,696) = 1764 square units.
  5. Diagonal p: sqrt(3528 x 4095/3640) = sqrt(3969) = 63 units.
  6. Diagonal q: sqrt(3528 x 3640/4095) = sqrt(3136) = 56 units.
  7. Circumradius: sqrt(3640 x 3528 x 4095)/(4 x 1764) = 229,320/7056 = 32.5 units. The tool shows 1764 square units, 88 units, 176 units, 63 units, 56 units and 32.5 units.

Reference table

Reference cyclic quadrilaterals computed with Brahmagupta's formula
Sides a, b, c, dSemiperimeterAreaDiagonals
52, 25, 39, 6088176463 and 56
6, 8, 6, 8 (rectangle)144810 and 10
5, 5, 5, 5 (square)10257.0711 each
3, 4, 5, 6918.97375.9402 and 6.5655

Limits

  • Requires a cyclic quadrilateral. For a general quadrilateral Bretschneider's formula subtracts a term involving the opposite angles, so this area is an overestimate.
  • Four side lengths do not fix a shape by themselves. The tool assumes the cyclic arrangement, which is the one that maximises area for those sides.
  • Each side must be shorter than the other three combined. Otherwise no quadrilateral can close and the tool returns an error message.
  • Every input uses one length unit. Area is reported in squared units and the diagonals and radius in the same unit as the sides.

Common mistakes

  • Applying the formula to a quadrilateral that is not cyclic, which gives an area that is too large.
  • Mixing units, such as entering two sides in centimetres and two in metres.
  • Ignoring the side condition and taking the square root of a negative radicand when one side is too long.
  • Forgetting that the semiperimeter uses all four sides, unlike the three side sum in Heron's formula.
  • Assuming the two diagonals are equal. They match for a rectangle, but Brahmagupta's example gives 63 and 56.

Try it yourself

Quick checks. Answers sit tucked under each question.

A square has four sides of 5 units. What area does Brahmagupta's formula give?

s = 10, so the area is sqrt(5 x 5 x 5 x 5) = 25 square units. The tool also gives diagonals of 7.0711 units and a circumradius of 3.5355 units.

A rectangle measures 6 units by 8 units. What do the formula and the derived values give?

Sides in order 6, 8, 6, 8 give s = 14 and area sqrt(8 x 6 x 8 x 6) = 48 square units, which agrees with 6 x 8. Each diagonal is 10 units and the circumradius is 5 units.

Find the area and the two diagonals for sides 3, 4, 5 and 6.

s = 9, so the area is sqrt(6 x 5 x 4 x 3) = sqrt(360) = 18.9737 square units. The diagonals are 5.9402 and 6.5655 units.

Questions

What does Brahmagupta's formula calculate?

The area of a quadrilateral inscribed in a circle, using only its four side lengths in order around the circle.

What makes a quadrilateral cyclic?

All four vertices lie on one circle. Equivalently, each pair of opposite angles adds to 180 degrees.

How is this related to Heron's formula?

Heron's formula is the limit of Brahmagupta's when one side becomes zero, turning the quadrilateral into a triangle.

What if my quadrilateral is not cyclic?

Use Bretschneider's formula, which subtracts a term based on two opposite angles. Brahmagupta's result is the special case where that term is zero.

Do I need the diagonals to find the area?

No. The four sides alone determine the area of the cyclic quadrilateral. The diagonals and circumradius are extra results computed from those sides.

Why is my set of sides rejected?

One side is at least as long as the other three together, so the four lengths cannot form a closed quadrilateral. Shorten that side and try again.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.