ForHosting KIT · Math

Area of a trapezoid calculator

Bases of 10 and 6 with a height of 4 give an area of 32: add the two parallel sides, halve the sum and multiply by the height. Useful for channel cross-sections, sloped roofs and tapered parts. 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
Area
32

Validation is strict — every dimension must be a positive finite number — and the same code that runs on our edge runs free in your browser on this page, so you only pay when you automate it.

The formula, and why it works

A trapezoid is a quadrilateral with exactly one pair of parallel sides, called the bases. The intuition is simple — a trapezoid is what you get when you slice the top off a triangle, and its area matches that of a rectangle whose width is the average of the bases and whose height is the same. That average is also the length of the median, the segment joining the midpoints of the non-parallel sides.

Because the formula only ever adds, halves and multiplies, the result is exact and deterministic: the same three numbers in, the same area out, on any machine, at any time. If you already know the median instead of the two bases, multiply it by the height directly and you will get the very same figure, which is a handy way to sanity-check a result.

Where it fits in practice

Trapezoid area shows up more often than the name suggests. Civil engineers compute the cross-sectional area of drainage channels and road embankments, which are trapezoidal by design, to estimate flow capacity and fill volumes. Architects use it for sloped roof faces, tapered walls and site plots with two parallel boundaries.

In manufacturing, sheet-metal and fabric parts are frequently trapezoidal, and the area drives material costing and cutting layouts. It is also the geometry behind the trapezoidal rule in numerical integration, where an area under a curve is approximated as a sum of trapezoids.

Estimate channel and embankment cross-sections

Compute the trapezoidal cross-sectional area of a drainage channel from its bed width, top width and depth to size flow capacity.

Quote sheet material for tapered parts

Feed the two parallel edges and the length of a trapezoidal blank into a costing pipeline to price metal or fabric accurately.

Check geometry homework at scale

An educational app validates student answers against the deterministic (a + b) / 2 × h result, including the expected rounding.

How is the result rounded?

Half-up to six decimal places by default. You can set decimals between 0 and 12; whole-number results are returned as clean numbers.

Is anything I send stored?

No. The dimensions are processed and discarded; only the computed area is returned.

Which measurements do I need?

The lengths of the two parallel sides, called the bases, and the perpendicular height between them. The slanted sides are not needed, because the area depends only on the average of the bases and the height.

What if I know the median instead of both bases?

Multiply the median by the height. The median joins the midpoints of the slanted sides and is exactly the average of the two bases, so you get the same area, which is also a handy way to check a result.

Why is a length of zero or below rejected?

In geometry a zero or negative length has no meaning, and computing with it would give a plausible-looking area built on bad data. The calculator stops instead, so a typo never turns into a wrong figure.

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/area-of-a-trapezoid

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/area-of-a-trapezoid \
  -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.area_of_a_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.

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 area of a trapezoid API takes the lengths of the two parallel sides and the perpendicular distance between them, and returns the area using the classic formula: add the bases, halve the sum, multiply by the height. It is the calculation behind roof slopes, cross-sections of channels and countless geometry exercises, done in one deterministic call.

The formula, and why it works

Its area equals the average of the two bases multiplied by the height: area = (base_a + base_b) / 2 × height. The endpoint mirrors that property — it performs no network calls, uses no randomness and reads no clock, so an automated pipeline can rely on byte-identical answers and cache them safely.

Inputs, validation and rounding

In geometry a zero or negative length is meaningless, and silently coercing a mistyped string into a number would return a plausible-looking area built on bad data — the worst kind of answer for an automated system. For the common case of whole-number inputs, for example bases of 10 and 6 with a height of 4, the computation is (10 + 6) / 2 × 4 = 32, returned as a clean integer-valued number with no floating-point surprise. The API accepts three required fields — base_a, base_b and height — plus an optional decimals field that controls rounding of the returned area, defaulting to six decimal places and capped between zero and twelve. Every dimension must be a positive finite number: missing fields, non-numeric values such as strings, NaN or Infinity, zero and negative lengths are all rejected with an invalid_input error, and an errored request is never billed. This strictness is deliberate.

Where it fits in practice

Teams wire this endpoint into quoting tools, educational apps and validation pipelines that check a dimensioned drawing before it reaches production. It runs on our global edge with nothing stored after the call, and the same module that answers the API executes free in your browser on this page, so you can verify a figure by hand and only pay when you automate the check across thousands of parts.

What does it cost?

$0.002 per request. It is also free to run in your browser on this page.

Which inputs are required?

base_a, base_b and height — the two parallel bases and the perpendicular distance between them. All must be positive finite numbers.

What happens if a dimension is zero, negative or not a number?

The request is rejected with an invalid_input error. Errored requests are never billed.

Does it matter which base is base_a and which is base_b?

No. The formula averages the two bases, so swapping them produces exactly the same area.

Read the full KIT documentation →