Trapezoid area calculator
Find the area of a trapezoid from its two parallel sides and its height, together with the midsegment: bases 8 and 12 with a height of 5 give a midsegment of 10 and an area of 50. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Base a
- 8
- Base b
- 12
- Height
- 5
- Midsegment
- 10
- Area
- 50
A trapezoid (trapezium in some regions) is a quadrilateral with exactly one pair of parallel sides, called the bases. Given the lengths of those two parallel sides and the perpendicular height between them, this calculator returns the trapezoid area and the midsegment (median) length—the segment that joins the midpoints of the non-parallel legs and equals the average of the bases.
Where trapezoid calculations show up in real work
Secondary-school and college geometry courses constantly ask students for the area of a trapezoid given two bases and height, and often for the midsegment on the same problem set; a trusted calculator with a strict non-negative gate speeds homework grading and removes spreadsheet mistakes where someone multiplies bases without averaging them. Architecture and civil workflows use trapezoidal sections for roof pitches, embankment cross-sections, and parcel sketches; having a shared numeric oracle keeps shop notes and office scripts aligned on the same average-of-bases path.
Manufacturing and fabrication teams size trapezoidal plates, duct transitions, and tapered panels from base lengths and height; area feeds material estimates while midsegment helps locate centerline features. Game, graphics, and CAD libraries store trapezoidal quads for terrain skirts, UI panels, and UV shells; deterministic area and midsegment support collision proxies and layout math without a full computational-geometry stack. If you later need non-parallel leg lengths from diagonals, trapezoid from four vertices, or irregular quadrilateral area via shoelace, treat those as separate search intents rather than overloading this trapezoid-area landing.
What you can do with it
Homework and exam checks
Compute trapezoid area and midsegment from two bases and height, and reject negative dimensions with a clear error.
Roof and embankment sections
From parallel base lengths and perpendicular height, recover area and midsegment for sketches, cut lists, and fill estimates.
FAQ
What happens if a base or the height is negative?
Dimensions must not be negative; the error message names the field.
Is a zero base or height allowed?
Yes. Zero is non-negative and yields a defined (possibly degenerate) area and midsegment—for example one base zero recovers a triangle of area half the other base times height.
What does it cost?
The browser tool is free and runs locally.
What is the area of a trapezoid with bases 8 and 12 and a height of 5?
The area is 50. The two bases average to 10, the midsegment, and 10 times the height of 5 gives 50, in the square of the unit you used.
What is the midsegment of a trapezoid?
It is the segment joining the midpoints of the two slanted legs, and its length is the average of the bases. Multiplied by the height it gives the area, and it also marks the centre line of a tapered panel.
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/trapezoid \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"base_a":8,"base_b":12,"height":5}'const res = await fetch("https://api.kit.forhosting.com/geom/trapezoid", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"base_a": 8,
"base_b": 12,
"height": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/trapezoid",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"base_a": 8,
"base_b": 12,
"height": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/trapezoid", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"base_a":8,"base_b":12,"height":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"base_a":8,"base_b":12,"height":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/trapezoid", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"base_a": 8,
"base_b": 12,
"height": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.trapezoid",
"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
Any negative base or height is rejected with a clear invalid_input error instead of a silent nonsense area. No network calls, no random sampling, and no floating-point surprises beyond ordinary IEEE-754 arithmetic on the numbers you provide.
How trapezoid area and midsegment are computed
Classic checks include bases eight and twelve with height five, which yield midsegment ten and area fifty; equal bases with positive height recover a rectangle; one base zero with positive height recovers a triangle of area half base times height. Because the path uses only addition, division by two, and multiplication, it is deterministic, O(1), and free of iterative solvers. Label the two parallel sides base_a and base_b and the perpendicular distance between their supporting lines as height. The midsegment (also called the median or midline of the trapezoid) has length equal to the arithmetic mean of the bases: midsegment equals (base_a plus base_b) divided by two. The area is that midsegment times the height, which expands to the familiar classroom formula area equals (base_a plus base_b) over two times height. This identity holds whether the figure is isosceles or scalene and whether the longer base sits at the bottom or the top; only the parallel pair and the perpendicular height matter for area and midsegment. Huge magnitudes can still overflow IEEE-754 double range; when intermediates are non-finite the request fails with a clear overflow message instead of returning Infinity in JSON. That closed form matches analytic geometry textbooks and keeps automated graders aligned with hand computation on the same three numbers.
What you send and what you get back
None of the three may be negative; zero is allowed and produces a mathematically defined (possibly degenerate) area and midsegment. Example checks: bases eight and twelve with height five yield midsegment ten and area fifty; bases six and six with height four yield a rectangle of area twenty-four; a negative height fails naming the field. Wire the free browser tool for quick sanity checks, then call the identical contract from scripts for bulk evaluation without reimplementing the average-of-bases formula in every language. Provide three required finite numbers: base_a and base_b are the lengths of the parallel sides, and height is the perpendicular distance between those parallels. Missing fields, empty strings, non-numeric text, NaN, Infinity, and any negative dimension are rejected with invalid_input and are not charged. On success the JSON response returns base_a, base_b, height, midsegment, area, and method set to trapezoid_avg_bases_height so logs and teaching UIs can document the algorithm. API pricing is the published base of $0.002 per successful item.
Where trapezoid calculations show up in real work
Because this capability is a pure parse engine, failed validation does not consume balance and successful runs stay at $0.002 per item.
Integration use cases
CAD and game trapezoidal plates
Turn two bases and height into area and midsegment for material, layout, and collision proxies in browser or API.
Technical questions
What formulas does this calculator use?
midsegment = (base_a + base_b) / 2, area = midsegment × height = (base_a + base_b) / 2 × height. The response includes method: "trapezoid_avg_bases_height".
Does the order of the two bases matter?
No. Area and midsegment depend only on the sum of the bases and the height; swapping base_a and base_b does not change the results.