Base of a triangle calculator
A triangle with an area of 10 and a height of 4 has a base of 5: double the area and divide by the height. It works for any triangle, as long as the height is measured at a right angle to the base. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Area
- 10
- Height
- 4
- Base
- 5
The base of a triangle is the side you treat as the bottom when you drop a perpendicular to the opposite vertex. Classroom geometry, roof takeoffs, lot sketches, and homework all rest on the same identity: the area equals one half of the base times that perpendicular height, so the unknown base is twice the area divided by the height. This calculator accepts two positive finite numbers — the area and the height — and returns the matching base length in the same unit system. It does not need the other two sides, an included angle, or a right-angle assumption: any triangle, scalene or isosceles, obeys the half-base-times-height formula.
What the formula means and why two numbers are enough
Any triangle, right or oblique, has area equal to one half of a chosen base times the perpendicular height to that base. Rearranging the identity is the whole algorithm this capability runs: if A equals one half b h, then b equals two A over h. The base is not a privileged side of the figure; it is whichever side you elect to treat as the bottom when you measure the altitude to the opposite vertex.
The height is not a slanted edge and is not the median or the angle bisector: it is the unique perpendicular distance from that vertex down to the line of the chosen base, even when the foot falls outside the segment on an obtuse triangle.
Because the formula never uses the other two sides, you can recover a missing frontage from a known lot area and a known depth, recover a gable wall width from a known triangular face area and a known ridge rise, or check a homework item that states area and height and asks only for the base. Units stay consistent: if area is in square metres and height is in metres, the base comes back in metres; if you pass square feet and feet you get feet.
A right triangle is a special case of the same identity, not a different one, so this solver is not limited to legs of a right triangle. Degenerate inputs are rejected rather than silently producing an infinite or zero-width strip: both area and height must be strictly positive and finite, because a zero height would divide by zero and a non-positive area is not a proper triangle under this contract.
Searchers looking for the base of a triangle typically already have those two numbers and want the missing length, not a general triangle toolkit that also asks for three sides, two angles, or vertex coordinates.
What you enter and what you get back
Zero and negative values also fail, because a geometric area and a geometric altitude must be strictly greater than zero — there is no meaningful base for a collapsed or inverted figure, and dividing twice a non-positive area by a height would invent a non-positive side. On success the body echoes area and height, returns base as twice the area divided by the height, rounds every numeric field to twelve decimal places for stable goldens across runtimes, and includes a formula string restating base equals two times area over height.
Example: area ten and height four yield base five, because two times ten over four is five. Area twenty-four and height six yield base eight. A check with area seven point five and height three yields base five.
Keep both inputs in matching units so the returned base is dimensionally honest.
Where a base-of-a-triangle calculator earns its keep
Surveyors, landscapers, and real-estate worksheets often know a triangular lot's area from a plat and the perpendicular depth from a stake; the missing street frontage is exactly this base. Roofers and carpenters who know the triangular gable-end area from a takeoff and the ridge rise from a section recover the plate-line width without re-measuring the wall. Fabricators and packaging tools that store only a triangular panel area and a known altitude recover the matching edge for cutting, folding, or gasket length.
Game and CAD macros that keep area and height convert to a base for collision padding, path length, or UV layout. Construction worksheets that give a triangular slab area and one known rise recover the remaining run of form board along the base.
Keep requests small, pin the rounded base in tests, and you get reproducible missing sides for homework, LMS plugins, CAD macros, and edge workers without standing up a general polygon library when the only unknown is the base of a triangle whose area and height are already known. Prefer this focused solver over an area-from-base-and-height tool when the search intent is specifically the missing base, and over a right-triangle-leg solver when the figure is not assumed to be right-angled.
What you can do with it
Lot frontage and gable width from a known area
A plat or takeoff that lists triangular area and a measured altitude becomes the missing street frontage or plate-line width without re-surveying the base edge.
CAD macros and LMS oracles
Scripts that store only panel area and altitude recover the matching edge for cutting, grading, or collision padding under one deterministic contract.
FAQ
How do I find the base of a triangle from its area and height?
Send two positive finite numbers: area A and perpendicular height h. The base is 2A/h. Example: area 10 and height 4 give base 5.
Does the height have to be perpendicular to the base?
Yes. The identity A = (1/2)·base·height requires the altitude at right angles to the chosen base line. A slanted side length is not the height.
What happens if area or height is zero, negative, or not a number?
Both area and height must be positive finite numbers; a zero height would divide by zero and a non-positive area is not a proper triangle here.
Is this the same as a right-triangle missing-leg calculator?
No. A right-triangle leg solver assumes a right angle and returns a cathetus (and often the hypotenuse). This calculator finds the base of any triangle from area and the perpendicular height to that base.
What unit is the base given in?
The same unit as the height. If the area is in square meters and the height in meters, the base comes back in meters; with square feet and feet, you get feet. Keep both in matching units.
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/math/base-of-a-triangle \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"area":10,"height":4}'const res = await fetch("https://api.kit.forhosting.com/math/base-of-a-triangle", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"area": 10,
"height": 4
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/base-of-a-triangle",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"area": 10,
"height": 4
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/base-of-a-triangle", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"area":10,"height":4}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"area":10,"height":4}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/base-of-a-triangle", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"area": 10,
"height": 4
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.base_of_a_triangle",
"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.
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
Zero, negative, or non-finite values fail with invalid_input and are not billed.
Input contract, response shape, and validation rules
POST a JSON body with two required fields: area, the positive finite area of the triangle, and height, the positive finite perpendicular altitude to the unknown base. The area may also arrive under the alias A; the height may arrive as h or altitude so client code can match textbook notation. Each value may be a JSON number or a numeric string; empty strings, missing fields, non-numeric text, NaN, and Infinity fail with invalid_input naming the field. Failed validation does not consume prepaid balance. Pair the response with your own unit conversion or drawing code if needed — this endpoint derives the missing base only and does not emit the other two sides, the angles, a sketch, or a conversion between metres and feet.
Integration use cases
Classroom and homework checks
Let students submit area and perpendicular height and verify the missing base against the textbook identity base = 2A/h, including obtuse triangles where the altitude foot sits outside the segment.
Technical questions
What does the base of a triangle calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.