Heron's formula calculator
Get a triangle's area from its three sides alone, without angles or a height: sides 3, 4 and 5 give a semiperimeter of 6 and an area of 6. Lengths that cannot close into a triangle are flagged. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- First side length
- 3
- Second side length
- 4
- Third side length
- 5
- Perimeter
- 12
- Semiperimeter
- 6
- Area
- 6
Heron's formula is the classic way to find a triangle's area when you know all three side lengths and none of the angles: a surveyor has paced the three edges of a plot; a student is given SSS data with no height; a game or CAD pipeline needs floor area from three measured edges without constructing altitudes by hand. This capability checks the strict triangle inequality so the figure is non-degenerate, forms the semiperimeter as half the sum of the sides, and returns the positive square root of s times each (s minus side).
What Heron's formula is and how the numbers work
Heron's formula (sometimes written Hero's formula) computes the area of a triangle from side lengths alone. Label the sides a, b, and c. First form the semiperimeter s equals (a plus b plus c) divided by two.
Then the area is the positive square root of s times (s minus a) times (s minus b) times (s minus c). That product under the radical is zero precisely when the sides are collinear—when one side equals the sum of the other two—so a strict triangle inequality is required: a plus b must exceed c, a plus c must exceed b, and b plus c must exceed a.
A classic sanity check is the three-four-five right triangle: perimeter twelve, semiperimeter six, and area six, matching half base times height with legs three and four. An equilateral triangle with equal sides five yields semiperimeter seven point five and area equal to the well-known (square root of three over four) times side squared, which you can cross-check by hand.
Every step is elementary arithmetic and one square root on three scalars, so there is no iteration, no sampling, no dependence on wall-clock time, and no need for angles or altitudes in the input contract.
What you can do with it
Surveying and plot takeoff from three measured edges
Turn paced or taped edge lengths of a triangular lot into floor or land area without constructing an altitude or measuring a corner angle.
Game, CAD, and mesh area from three edge lengths
Validate a triangle face or compute surface area when only the three edge lengths are known in the scene graph or mesh data.
FAQ
What is Heron's formula?
Heron's formula finds a triangle's area from three side lengths a, b, and c. With semiperimeter s = (a+b+c)/2, the area is sqrt(s(s−a)(s−b)(s−c)).
What is the triangle inequality?
Each side must be strictly shorter than the sum of the other two: a+b>c, a+c>b, and b+c>a. If any fails, the lengths do not form a non-degenerate triangle.
Why are collinear sides rejected instead of returning area zero?
When a+b=c the figure is a line segment, not a triangle.
Does this need angles or height?
No. Only the three side lengths are required. If you have two sides and the included angle instead, use an SAS triangle calculator.
Is the Heron's formula calculator free?
The browser tool is free and runs locally.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geom/heron-area \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":3,"b":4,"c":5}'const res = await fetch("https://api.kit.forhosting.com/geom/heron-area", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 3,
"b": 4,
"c": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/heron-area",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 3,
"b": 4,
"c": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/heron-area", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":3,"b":4,"c":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":3,"b":4,"c":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/heron-area", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": 3,
"b": 4,
"c": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.heron_area",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_side | 1000000000000 |
min_side | 1e-15 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Results are deterministic JSON—no computer-algebra system, no random seeds, and the same pure solve function in the free browser tool and the prepaid API path—so homework checks, grading scripts, and production pipelines all see the same numbers every time.
What Heron's formula is and how the numbers work
When any of those fails, no triangle exists and this tool returns invalid_input rather than a zero or imaginary area.
How to call the API and what comes back
Use it from geometry homework pipelines, construction takeoff scripts, game-level tooling, interview-prep sandboxes, land-area checks from paced edges, or any workflow that needs a reproducible SSS area without installing a computer-algebra package on every machine. Send a JSON body with three fields. Field a is the first positive side length; aliases side_a and side1 are accepted. Field b is the second positive side; aliases side_b and side2 map to the same meaning. Field c is the third positive side; aliases side_c and side3 are accepted. On success the response echoes a, b, and c, adds perimeter, semiperimeter, area, method set to heron, and a short formula block documenting the closed forms for s and the area radical. Failed validation—missing a required field, a non-finite number, a non-positive side, a side outside published limits, or a triple that breaks the strict triangle inequality—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, limits, and related searches
When teaching, prefer paired examples: three-four-five for a right triangle with integer area six; five-five-five for equilateral area; and one-two-ten to demonstrate the hard rejection path that protects callers from a non-triangle. Prefer Heron when you measured or were given all three edges and have no reliable height or angle. Round-trip checks are easy: after solving, confirm that perimeter equals a plus b plus c, that semiperimeter is half that, and that area squared equals s times each (s minus side) within floating tolerance. Keep side lengths inside the published positive range up to one trillion so intermediate products stay finite in IEEE double precision on the Worker and in the browser. Units are whatever you pass—metres, feet, or game units—as long as all three sides share the same unit; the API does not convert units for you. Because the formula only needs sides, students can recompute s and the four factors by hand for small integers and match the API line by line. This landing targets people searching for a Heron's formula calculator or a triangle area from three sides tool; it is not an SAS angle-based solver—use the dedicated SAS capability when you know two sides and the included angle instead of three lengths. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when users type impossible triples while learning the contract.
Integration use cases
Homework and exam checks for SSS area problems
Give students three side lengths; compare their hand-computed semiperimeter and Heron area against a deterministic API or free browser result.