ForHosting KIT · Math

Irregular trapezoid area calculator

Measure the two parallel sides and the gap between them to get the area of any trapezoid, crooked legs included: bases of 10 and 6 metres, 4 metres apart, give 32 square metres. Handy for plots, roof planes and channels. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Base a
10
Base b
6
Height
4
You get
Mean base
8
Area
32

two parallel sides and height, free

Why irregular trapezoids are everywhere

Textbook geometry loves the isosceles trapezoid, where both legs match and every angle is predictable. Real measurements rarely cooperate. A garden plot bounded by a road and a river, a gable roof cut by a dormer, a channel cross-section dug by hand, an offcut of plywood from a larger sheet: all of these are trapezoids whose non-parallel sides have nothing in common.

The good news is that the area formula does not care. Because the area depends only on the two parallel sides and the perpendicular distance between them, you can ignore the slanted legs entirely — their length and angles are irrelevant to the surface. If the two bases measure 10 and 6 metres with 4 metres of separation, the area is 32 square metres, whether the left leg is vertical or leans at any angle.

The calculator returns that area together with the mean base, the intermediate value (a + b) / 2, so you can sanity-check the arithmetic against a sketch.

How the computation works and what it rejects

The algorithm is one line of arithmetic applied with strict validation. In geometry a zero or negative base describes no figure at all, and silently clamping it to a small positive value would produce an area that looks plausible while being wrong — the worst kind of answer for a quantity that feeds material orders or land valuations. Results are rounded to ten decimal places so that the same request returns byte-identical output on any machine, which matters when the response is stored, compared or replayed in tests.

There is no randomness, no clock, no network call: the function is a pure mapping from three numbers to an area.

Estimate an irregular land parcel

Survey a plot bounded by two roughly parallel fences: measure both fence lines and the perpendicular distance between them, and get the area without knowing the angles.

Price roofing or flooring on a non-rectangular plan

Convert a trapezoidal roof plane or floor section into square metres so material quantities and quotes are based on the real surface, not a rectangular guess.

Check channel and gutter cross-sections

Compute the cross-sectional area of a trapezoidal drainage channel from its top width, bottom width and depth — the first step of any flow-capacity estimate.

Which measurements do I need?

The slanted legs are never needed for the area.

Does it work for non-isosceles (irregular) trapezoids?

Yes. The formula A = (a + b) / 2 x h holds for every trapezoid regardless of the leg lengths or angles, which is why only three measurements are required.

What input is rejected?

Any value that is not a positive finite number: zero, negatives, NaN, Infinity, booleans, empty strings and non-numeric text.

Is the result deterministic?

Yes. The same three inputs always produce byte-identical output; results are rounded to ten decimal places so the response is stable across machines.

What is the mean base shown next to the area?

It is the average of the two parallel sides, (a + b) / 2, and multiplying it by the height gives the area. For bases of 10 and 6 the mean base is 8, which lets you check the result against a quick sketch.

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.

POSThttps://api.kit.forhosting.com/math/irregular-trapezoid-area

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.

curl -X POST https://api.kit.forhosting.com/math/irregular-trapezoid-area \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"base_a":10,"base_b":6,"height":4}'
{
  "base_a": 10,
  "base_b": 6,
  "height": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.irregular_trapezoid_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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The irregular trapezoid area API computes the surface of any trapezoid from the only three measurements that matter: the two parallel sides and the perpendicular height between them. It does not ask whether the legs are equal, whether the angles are right, or whether the figure is isosceles — the formula A = (a + b) / 2 x h holds for every trapezoid, regular or not, which is exactly what makes it useful for real-world plots of land, roof planes, cross-sections and sheet material that never come in tidy shapes. You send three positive numbers, you get back the area plus the mean base used to derive it, in one deterministic call that runs in microseconds and costs $0.002 per request.

Why irregular trapezoids are everywhere

That is the insight behind this endpoint: instead of forcing you to measure diagonals, angles or leg lengths that are awkward to reach on a physical site, it asks only for the three values a tape measure or a site plan already gives you.

How the computation works and what it rejects

Each of the three inputs — base_a, base_b and height — is parsed as a finite number, whether it arrives as a JSON number or as a plain numeric string such as "7.25". Anything that is not a positive finite number is rejected with an invalid_input error and is never billed: zero, negative lengths, NaN, Infinity, booleans, empty strings and text like "ten" all fail before a single multiplication happens. That strictness is deliberate. Once the inputs pass, the mean base is computed as (base_a + base_b) / 2 and multiplied by the height.

Using it from the web page and from your code

Typical integrations include land-survey tools that split parcels into trapezoidal strips, construction estimators that price roofing or flooring over non-rectangular plans, and educational software that checks student answers against a reference computation. Through the API you post a small JSON object with base_a, base_b and height — the aliases a, b and h are accepted for convenience — and you receive the area, the mean base and the echoed inputs in a single response. Each call costs $0.002, with no per-unit surcharge, and invalid input is rejected without charge. Because the endpoint is stateless and deterministic, it caches cleanly in front of your own infrastructure and behaves identically under load, in tests and in production.

What does it cost?

$0.002 per request, with no per-unit surcharge. It is also free to run in your browser on this page.

Can I send the values as strings?

Yes. Plain numeric strings such as "7.25" are accepted, as are JSON numbers. The aliases a, b and h work in place of base_a, base_b and height.

Read the full KIT documentation →