Trapezoid Calculator
Solve a trapezoid from its two parallel sides plus either both legs or the height. Get exact area, perimeter, height, median, diagonals and base angles.
Trapezoid Calculator
Background.
The Quanta trapezoid calculator solves the whole shape, not just its area. Give it the two parallel sides plus either both legs or the perpendicular height, and it returns the area, the perimeter, the height, the median, both diagonals and both base angles. With the default figures — a long base of 10, a short base of 4, and legs of 5 and 7 — the height comes back as 4.8989794856, the area as 34.292856399, the perimeter as exactly 26, the median as exactly 7, and the two diagonals as exactly 7 and 10.246950766.
The leg mode is the reason this page exists, and it is the default. Two parallel sides and a height are not enough to pin a trapezoid down: you can slide the short base left or right along its line and the area never changes, but the legs, the diagonals and the angles all do. That is why a general area-and-perimeter tool can give you an exact area from a height and then only guess at the perimeter. Enter the legs instead and there is nothing left to guess — the shape is fully determined, and every number on this page is exact.
If the height is what you have, pick one of the two assumption modes and the page will say which assumption it made. Isosceles mode splits the overhang evenly, so the legs come out equal, the diagonals come out equal and the two base angles match. Right-trapezoid mode puts one leg perpendicular to both bases, so the left base angle is exactly 90°. Neither is a measurement; both are choices, and they are labelled as choices right on the mode selector rather than buried three screens down.
Not every set of four numbers describes a trapezoid. Slide the right leg along the bases until it meets the foot of the left leg and the two legs plus the overhang a − b form a triangle, so the shape exists only when the overhang is bigger than the difference of the legs and smaller than their sum. Break that and the height would come out imaginary; this calculator refuses the input and names the inequality you broke instead of returning a meaningless number.
One naming note belongs up here rather than in a footnote. This page uses the North American sense of the word: a quadrilateral with one pair of parallel sides. In British usage the same shape is a trapezium, and confusingly a British trapezoid is a quadrilateral with no parallel sides at all. Wolfram MathWorld states the equivalence directly — the trapezoid is the British trapezium — and Euclid, writing long before either convention, used trapezia as a catch-all for every quadrilateral that was not a square, an oblong, a rhombus or a rhomboid. The page also follows the exclusive definition, under which a parallelogram is not a trapezoid, so it requires the long base to be strictly longer than the short one. Enter two equal parallel sides and it will tell you to use the area and perimeter calculator instead, rather than quietly reporting a parallelogram's numbers under a trapezoid's name.
What is trapezoid calculator?
A trapezoid is a quadrilateral with one pair of parallel sides. Wolfram MathWorld defines it as "a quadrilateral with two sides parallel" and notes that "the trapezoid is equivalent to the British definition of trapezium". The two parallel sides are the bases, conventionally a for the longer and b for the shorter; the other two sides are the legs, c and d; and the perpendicular distance between the bases is the height h.
The area is MathWorld's Equation (1), A = ½(a + b)h — the average of the two parallel sides multiplied by the distance between them. That average has a name and a geometric meaning of its own: the median or midsegment, Equation (10), m = ½(a + b), is the segment joining the midpoints of the two legs, and it is parallel to both bases with exactly that length. So the area is simply the median times the height, which is why a trapezoid behaves like a rectangle of the same height whose width is the average of its two ends.
What a trapezoid is not is determined by its area alone. Two parallel sides and a height leave one degree of freedom — the horizontal offset of the short base, written p on this page — and that offset controls the legs, the diagonals and all four interior angles while leaving the area untouched. Fixing the two legs removes the last freedom. MathWorld gives the resulting height in closed form at Equation (19), h = η / (2|b − a|) with η = √((−a+b+c+d)(a−b+c+d)(a−b+c−d)(a−b−c+d)), and the two diagonals at Equations (17) and (18). This calculator reaches the same numbers by a different route — placing the shape on coordinate axes and solving for p — and the test suite checks the two routes against each other on every run.
Special cases are worth naming. An isosceles trapezoid has equal legs; equivalently, equal base angles, or equal diagonals — any one of the three implies the other two, which makes measuring the diagonals a fast way to check a shape in the workshop. A right trapezoid has two right angles, meaning one leg is perpendicular to both bases. And under the exclusive definition used here, a parallelogram — where both pairs of sides are parallel and the two bases are equal — is not a trapezoid at all.
How to use this calculator.
- Choose your mode. Pick the first option if you have measured both legs: the trapezoid is then fully determined and every result is exact. Pick isosceles or right-trapezoid only if all you have is the height, and read the assumption each one makes.
- Enter base a, the longer of the two parallel sides. It must be strictly longer than base b — equal parallel sides make a parallelogram, which this page will not report as a trapezoid.
- Enter base b, the shorter parallel side. Any unit works, as long as all four inputs use the same one; lengths come back in that unit and the area in that unit squared.
- In leg mode, enter legs c and d. Left and right only matter for which base angle is which; swapping them mirrors the shape and leaves the area, perimeter and median unchanged.
- In the two height modes, enter the perpendicular gap between the parallel sides. Measure straight across at a right angle, not along a leg — a leg is always at least as long as the height and is usually longer.
- Read the area at the top, then the perimeter, height and median below it. The median is the average of the two bases and is what the area is really built from.
- Use the two diagonals to check a shape you have already built. If they come back equal, the trapezoid is isosceles; if they differ, it is not, no matter how symmetric it looks.
- If the calculator refuses your legs, read the message: it will tell you whether the overhang a − b was too big for the legs to reach or too small for them to spread. That is the triangle inequality applied to c, d and a − b.
The formula.
Place the longer base on the x-axis with its left end at the origin, so the corners are (0, 0), (a, 0), (p + b, h) and (p, h). The unknown p is how far the short base's left end sits to the right of the origin. Writing the two legs with the distance formula gives c² = p² + h² and d² = (k − p)² + h², where k = a − b. Subtract the first from the second and h² cancels, leaving a linear equation in p whose solution is p = (k² + c² − d²) ⁄ 2k. Put that back into the first equation and h = √(c² − p²). Everything else is now a distance or an angle read straight off the coordinates, with no further assumption anywhere.
Working the default all the way through: a = 10, b = 4, c = 5, d = 7, so k = 6 and p = (36 + 25 − 49) ⁄ 12 = 1. The height is √(25 − 1) = √24 = 4.898979485566356, displayed as 4.8989794856. The median is ½(10 + 4) = 7 exactly, so the area is 7 × 4.898979485566356 = 34.29285639896449, displayed as 34.292856399. The perimeter is 10 + 4 + 5 + 7 = 26, exactly. The first diagonal runs from (0, 0) to (5, 4.898979485566356), so its length is √(25 + 24) = √49 = 7 exactly; the second runs from (10, 0) to (1, 4.898979485566356), giving √(81 + 24) = √105 = 10.246950765959598, displayed as 10.246950766. The base angles are atan2(4.898979485566356, 1) = 78.4630409672° and atan2(4.898979485566356, 5) = 44.4153085972°.
The same trapezoid can be checked without any of this machinery. Cut it into a parallelogram of width b and a triangle whose sides are the two legs and the overhang — here a triangle with sides 5, 6 and 7. Heron's formula gives that triangle's area as √(9 × 4 × 3 × 2) = √216 = 14.696938456699069, so its height on the base of 6 is 2 × 14.696938456699069 ⁄ 6 = 4.898979485566356, the same h. The whole area is then 4 × 4.898979485566356 + 14.696938456699069 = 34.29285639896449, the same area. Two derivations that share no algebra land on the same digits.
The height modes replace the solve for p rather than the rest of the computation. Isosceles mode sets p = k ⁄ 2, so the overhang splits evenly and the legs come out equal; right-trapezoid mode sets p = 0, so the left leg is vertical. Both then run the identical code, which is why right-trapezoid mode returns a left leg of exactly the height and a left base angle of exactly 90° without either being hard-coded.
Rounding stage: every intermediate is carried at 40 significant digits and rounded once, at the return boundary, to 10 decimal places. π is computed as arccos(−1) at that precision for the radians-to-degrees conversion rather than typed as a literal. The offset p and the height h are never rounded before the legs, diagonals, area and angles are derived from them — rounding the pivot first would put visible error in the diagonals, which are quadratic in p, and would destroy the exact 7 that the first diagonal returns here. Nothing on this page is sorted into bands or graded, so no wording depends on a rounded value.
A worked example.
A carpenter is building a tapered planter box. The bottom board is 10 inches across, the top opening is 4 inches, and the two slanted sides measure 5 inches and 7 inches — deliberately different, because the box is meant to lean. Entering those four numbers in leg mode returns a height of 4.8989794856 inches, which is the vertical depth of the profile and the number needed to work out how tall the box stands. The area of the end panel comes back as 34.292856399 square inches, so a pair of ends takes just under 69 square inches of stock. The perimeter is exactly 26 inches of edge to sand, and the median is exactly 7 inches: cut a horizontal brace halfway up and it will measure 7 inches, the average of 10 and 4, whatever the lean is doing. The two diagonals are exactly 7 inches and 10.246950766 inches, and they are the numbers to measure against once the panel is glued up — if they come back matching each other rather than 7 and 10.25, the panel has been assembled as an isosceles trapezoid and one of the legs is on the wrong side. The base angles are 78.4630409672° on the 5-inch side and 44.4153085972° on the 7-inch side, so the mitre saw wants roughly 78.5° and 44.4° from the bottom edge, and the two top corners are their supplements, about 101.5° and 135.6°. One check worth doing before cutting: the overhang is 10 − 4 = 6 inches, the legs differ by 2 and sum to 12, and 6 sits comfortably between those, so the shape closes. Had the carpenter asked for a 13-inch bottom with the same legs the overhang would have been 9, still legal, but a 17-inch bottom would give an overhang of 13 against a leg sum of 12, and no such box can be built at all.
Frequently asked questions.
What is the formula for the area of a trapezoid?
Why does this calculator ask for both legs instead of just the height?
How do I find the height of a trapezoid if I only know the four sides?
Why does the calculator reject my four side lengths?
How do I know whether my trapezoid is isosceles?
What is the median or midsegment of a trapezoid?
Is a parallelogram a trapezoid? What about the British trapezium?
Can I use this page for a trapezoidal prism or a trapezoidal channel?
References& sources.
- [1]Wolfram Research, MathWorld — ‘Trapezoid’ (live revision retrieved 2026-07-29). Source for Equation (1) area A = ½(a + b)h, Equation (10) median m = ½(a + b), Equations (17) and (18) for the two diagonals in terms of the four side lengths, and Equation (19) height h = η/(2|b − a|) with η = √((−a+b+c+d)(a−b+c+d)(a−b+c−d)(a−b−c+d)). Also the statement ‘The trapezoid is equivalent to the British definition of trapezium.’ Equations (17), (18) and (19) are asserted against this module's independently derived values in trapezoid.test.ts. Open access.
- [2]Wolfram Research, MathWorld — ‘Heron's Formula’ (live revision retrieved 2026-07-29). Equation (2), Δ = √(s(s − a)(s − b)(s − c)) with s the semiperimeter. Used as a third, fully independent derivation of the trapezoid's height: the triangle formed by the two legs and the overhang a − b has area √216 and therefore height 4.898979485566356 on a base of 6, matching the coordinate solution exactly. Open access.
- [3]Euclid, Elements, Book I, Definition 22 — after defining the square, oblong, rhombus and rhomboid, ‘let quadrilaterals other than these be called trapezia.’ David E. Joyce web edition of the Heath translation, Clark University; quotation confirmed on retrieval 2026-07-29. Cited for the naming history and the definitional scope note, not for any computed value.
- [4]Wolfram Research, MathWorld — ‘Triangle Inequality’ (live revision retrieved 2026-07-29). The condition that a triangle with sides x, y and z exists only when each side is shorter than the sum of the other two. Applied here to the legs c and d and the overhang a − b, it is the exact existence condition for a trapezoid and is what this calculator enforces before computing anything. Open access.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 977 calculators remain free
- No billing is enabled