Triangle area Heron's formula calculator
Sides of 3, 4 and 5 give a semiperimeter of 6 and an area of 6. Enter three side lengths, no angle or height needed, and get the area and perimeter, or a clear notice when the sides cannot form a triangle. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A
- 3
- B
- 4
- C
- 5
- Perimeter
- 12
- Semiperimeter
- 6
- Area
- 6
When you know only the three side lengths of a triangle and none of the angles or the height, Heron's formula is the standard closed form that still yields the area. Surveyors pace three edges of a triangular plot; students receive SSS homework with no altitude drawn; CAD and game pipelines store mesh faces as three edge lengths without an attached base-height pair. This capability validates that the sides form a non-degenerate triangle, builds the semiperimeter as half the perimeter, and returns the positive square root of s times each (s minus side).
What Heron's formula computes and why the triangle inequality matters
Heron's formula (also called Hero's formula) computes the area of any non-degenerate triangle from its three side lengths alone. Label the sides a, b, and c. First form the semiperimeter s as (a plus b plus c) divided by two.
Then the area is the positive square root of the product s times (s minus a) times (s minus b) times (s minus c). That product under the radical is zero exactly when the three lengths 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 integer check is the three-four-five right triangle: perimeter twelve, semiperimeter six, and area six, matching half of base three times height four. An equilateral triangle with equal sides five yields semiperimeter seven point five and area equal to the familiar (square root of three over four) times side squared, which you can recompute by hand for a cross-check.
Every step is elementary arithmetic plus 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 triangle area 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/trig/area-heron \
-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/trig/area-heron", {
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/trig/area-heron",
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/trig/area-heron", 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/trig/area-heron", 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": "trig.area_heron",
"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
What Heron's formula computes and why the triangle inequality matters
When any of those three checks fails, no triangle exists and this tool returns invalid_input rather than a zero, negative, or imaginary area. Floating intermediate products stay finite when sides stay inside the published positive range up to one trillion, which is the practical envelope for both the Worker and the browser path.
How to call the calculator and how to read the response
Round-trip checks are easy after a success: confirm that perimeter equals a plus b plus c, that semiperimeter is half that value, and that area squared equals s times each (s minus side) within ordinary floating tolerance. Send a JSON body with three required positive finite numbers. Field a is the first side length; aliases side_a and side1 are accepted and map to the same meaning. Field b is the second side; aliases side_b and side2 work the same way. Field c is the third side; aliases side_c and side3 are accepted. On success the response echoes a, b, and c after fixed twelve-decimal rounding, adds perimeter, semiperimeter, area, method set to heron, and a short formula block that documents the closed forms for s and the area radical. Failed validation—missing a required field, a non-finite value, 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. Use the endpoint 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. 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.
Practical tips, limits, and when to choose Heron over other solvers
Prefer paired teaching 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 measurement. Prefer base-times-height when the altitude is already known and you only need a quick half product. Prefer coordinate or shoelace methods when vertices are given as points rather than edge lengths. Keep side lengths strictly positive and at most one trillion so intermediate products remain finite in IEEE double precision on the Worker and in the browser. 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 triangle area Heron's formula calculator or a three-sides area tool; it is not an SAS angle-based solver—use a 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. Pin the rounded area and semiperimeter in automated tests so refactors of the Worker path cannot silently change classroom or production numbers. If you only need the semiperimeter without the square root, you can still call this endpoint and ignore the area field, or use a dedicated semiperimeter helper when that is the only quantity you care about.
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.