Home Calculators Categories Category: Math, Statistics & Education

Heron's Formula Calculator

This Heron's formula calculator finds the area of a flat triangle when you know all three side lengths. You don't need a height or an angle. Enter the sides to get the area and the semiperimeter (half the distance around the triangle), with worked steps that show the substitution and the value under the square root.

Input
Load a triangle to try the formula with known side lengths.

Use the same length unit for all three sides.

Type the first side length or adjust it with the slider.
Enter the second side in the same unit as the first.
The longest of the three sides must be shorter than the other two combined.
Visual
Triangle diagram
Output
Triangle area
6 units²
6 units
Semiperimeter
Worked steps
  1. s = (3 + 4 + 5) ÷ 2 = 6 units
  2. A = √(6 × 3 × 2 × 1) = √36
  3. A = 6 units²

Displayed numbers use up to seven significant digits.

How to Use the Calculator

  1. Use one length unit. All three sides might be in centimeters, meters, or feet, for example. The calculator does not convert units.
  2. Enter Side a, Side b, and Side c. The order doesn't affect the area or semiperimeter.
  3. Read the results. Triangle area is the main result, and Semiperimeter appears as the secondary result.
  4. Check the Worked steps. This panel is open by default and shows how the results were calculated.

The calculator starts with a 3–4–5 right triangle. The Example triangles selector also offers a 13–14–15 triangle, and it switches to Custom triangle when you edit a side.

Entry limits

Each side must be from 0.000001 to 1,000,000,000, inclusive, with up to 30 significant digits and 80 characters. You can type decimals or scientific notation, such as 2.5e3 for 2,500.

The sliders initially run from 0.1 to 20 in steps of 0.1. Type a value directly if you need finer precision or a length below 0.1. Entering a valid value above a slider's range extends its upper limit.

Heron's Formula and Its Variables

For a triangle with side lengths aa, bb, and cc, Heron's formula is:

A=s(s−a)(s−b)(s−c)A=\sqrt{s(s-a)(s-b)(s-c)}
Symbol Meaning
a,b,ca, b, c The three side lengths, in the same unit
ss The semiperimeter
AA The area, in square units

The expression under the square root is called the radicand. It is the product of four numbers: ss, s−as-a, s−bs-b, and s−cs-c.

The formula is named after Hero (or Heron) of Alexandria, who presented it in his work Metrica in the first century AD.

Semi-Perimeter of a Triangle Formula

The perimeter is the total length of the three sides:

P=a+b+cP=a+b+c

The semiperimeter is half of that total:

s=P2=a+b+c2s=\frac{P}{2}=\frac{a+b+c}{2}

For sides 13, 14, and 15:

s=13+14+152=21s=\frac{13+14+15}{2}=21

The semiperimeter is a length, not an area. If the sides are in meters, ss is also in meters.

Area of a Triangle with 3 Sides Using Heron's Formula

To calculate the area by hand, find the semiperimeter, subtract each side from it, multiply the four values, and take the positive square root.

Example: 13–14–15 triangle

Let a=13a=13, b=14b=14, and c=15c=15. As found above, s=21s=21.

The three differences are:

s−a=8,s−b=7,s−c=6s-a=8,\qquad s-b=7,\qquad s-c=6

Substitute them into the formula:

A=21×8×7×6A=\sqrt{21\times8\times7\times6}
A=7056=84A=\sqrt{7056}=84

The area is 84 square units. The number under the square root, 7,056, is not the area. You must take its square root.

Example with a rounded square root

For sides 5, 6, and 7, the semiperimeter is 9:

A=9(9−5)(9−6)(9−7)A=\sqrt{9(9-5)(9-6)(9-7)}
A=9×4×3×2=216≈14.69694A=\sqrt{9\times4\times3\times2}=\sqrt{216}\approx14.69694

The area is approximately 14.69694 square units. When calculating by hand, keep extra digits until the final step to limit rounding error.

Understanding Your Results

Area units

The calculator labels lengths as units and area as units². Replace “units” with the unit you used. Sides of 3, 4, and 5 cm give a semiperimeter of 6 cm and an area of 6 cm².

Convert mixed measurements before entering them. For sides of 1.2 m, 90 cm, and 150 cm, change 1.2 m to 120 cm. Entering 120, 90, and 150 gives an area of 5,400 cm², which equals 0.54 m².

Exact and rounded values

In the worked steps, = marks an exact displayed relationship, while ≈ marks a rounded one. Results and intermediate values are shown to up to seven significant digits, using scientific notation where applicable.

The semiperimeter, differences, and radicand are calculated with exact decimal arithmetic. The radicand is then converted to a double-precision number to take the square root, so a displayed area can be an approximation.

The number of digits displayed is separate from the number you can enter. A value shown as rounded does not mean your input was shortened to seven digits.

Triangle diagram

The shaded diagram updates with your inputs. It places the longest side at the base, although very close lengths can tie at the diagram’s drawing precision. It keeps the original labels a, b, and c, so any of them can label the base. You can zoom and pan without changing any measurements or results.

When Do Three Sides Form a Triangle?

The two shorter sides must add up to strictly more than the longest side. This rule is called the triangle inequality.

Sides Comparison Result
3, 4, 5 3+4>53+4>5 Valid triangle
3, 4, 7 3+4=73+4=7 Invalid: flat, with zero area
3, 4, 8 3+4<83+4<8 Invalid: the sides cannot meet

The calculator checks this rule using exact decimal arithmetic. For example, it recognizes that 0.1 + 0.2 equals 0.3 exactly, so those three lengths do not form a triangle.

For invalid input, an error appears, numeric results change to em dashes, and the worked steps and diagram become unavailable. Copy and export are also disabled. Check for a mistyped value, mixed units, a length outside the entry limits, or sides that fail the triangle inequality.

Very Thin Triangles and Measurement Sensitivity

A triangle can be valid but nearly flat. Its area may then change noticeably after a small change in one side.

Sides Area in square units
3, 4, 6.999 ≈ 0.2049018
3, 4, 6.998 ≈ 0.2897223

Here, changing the longest side by only 0.001 increases the area by about 41%.

The calculator shows a Very thin triangle advisory when the following gap is positive and strictly less than 0.001 times the longest side:

gap=(sum of the two shorter sides)−(longest side)\text{gap}=(\text{sum of the two shorter sides})-(\text{longest side})

The advisory does not mean the triangle is invalid. Keep extra measurement digits, and remember that more typed digits do not make the original measurement more accurate.

Rounding can also hide a very small difference. If the longest side is entered as 6.9999999999999999 with sides 3 and 4, the actual semiperimeter is 6.99999999999999995. The worked steps show it as ≈ 7, but the triangle still has a positive area, displayed as 6.480741e-8 square units. The notation e-8 means “multiplied by 10−810^{-8}.” Rounding both the semiperimeter and the longest side to 7 before recalculating would incorrectly give zero.

How to Verify the Area

Check a right triangle

If the side lengths satisfy a2+b2=c2a^2+b^2=c^2, the triangle is right-angled, with aa and bb as its perpendicular sides. For the 3–4–5 triangle:

A=12×3×4=6A=\frac{1}{2}\times3\times4=6

This agrees with Heron's formula:

A=6×3×2×1=36=6A=\sqrt{6\times3\times2\times1}=\sqrt{36}=6

Check with base and height

If you independently know the height perpendicular to a chosen side, use:

A=12×base×heightA=\frac{1}{2}\times\text{base}\times\text{height}

The 13–14–15 triangle has a height of 12 when the side of length 14 is the base. Therefore, its area is 12×14×12=84\frac{1}{2}\times14\times12=84, matching the earlier result.

A height calculated from the Heron area, using h=2A/baseh=2A/\text{base}, is not an independent check.

Why Heron's Formula Works

The usual area formula needs a height, but the three side lengths already determine that height. If CC is the angle between sides aa and bb, then:

A=12absin⁡CA=\frac{1}{2}ab\sin C

The law of cosines expresses the angle using only the sides:

cos⁡C=a2+b2−c22ab\cos C=\frac{a^2+b^2-c^2}{2ab}

Combining these with sin⁡2C+cos⁡2C=1\sin^2 C+\cos^2 C=1 and factoring gives:

16A2=(a+b+c)(−a+b+c)(a−b+c)(a+b−c)16A^2=(a+b+c)(-a+b+c)(a-b+c)(a+b-c)

The four factors on the right equal 2s2s, 2(s−a)2(s-a), 2(s−b)2(s-b), and 2(s−c)2(s-c). Dividing by 16 and taking the positive square root gives Heron's formula.

Copy, Export, and Reset

  • Copy copies the side lengths and results.
  • Export opens the print dialog, where you can also save the result as a PDF.
  • Reset restores the 3–4–5 example, reopens Worked steps, and resets the diagram view.
  • Help explains entry limits, units, calculations, the diagram, and thin triangles.

Frequently Asked Questions

Can Heron's formula be used for any triangle?

It works for any valid flat (Euclidean) triangle, including acute, right, obtuse, scalene, isosceles, and equilateral triangles. It does not apply unchanged to triangles drawn on curved surfaces such as a sphere.

Do I need to know an angle or the height?

No. The three side lengths are enough to find the area. If you have only two sides, you need more information, such as the angle between them.

Does it matter which side I call a, b, or c?

No. Reordering the sides changes their labels and the order of the factors, but not the area or semiperimeter.

Why is my area in square units?

Area measures the surface inside the triangle. The four factors under the square root are all lengths, so their product has units to the fourth power. Taking the square root gives square units.

Calculation Methodology Documented

Read the formula definitions, supported input ranges, and limitations before using this estimate.

Review Methodology
Debjeet Bhowmick
Author Debjeet Bhowmick AWS Certified Solutions Architect • Cloud & DevOps Consultant

AWS Certified Solutions Architect Professional and Senior Cloud & DevOps Consultant with over 14 years of hands-on expertise architecting resilient cloud infrastructure across AWS, GCP, and Azure. Specializes in infrastructure as code, continuous delivery automation, and telemetry across Terraform, Ansible, Docker, Kubernetes, ELK, Python, and SQL. Creator of OrangeCalc, delivering client-side high-precision computational tools.