{
  "id": "trapezoid",
  "version": "3f5fbc75184d",
  "status": "published",
  "name": "Trapezoid Calculator",
  "question": "What is the area of my trapezoid?",
  "summary": "Computes a trapezoid’s area, midsegment and perimeter from its bases and height, or its height, area and angles from all four sides.",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/trapezoid-calculator",
  "markdown": "https://www.acalculator.org/math/trapezoid-calculator.md",
  "kind": "function",
  "method": "Area = (a + b) ÷ 2 × h; midsegment = (a + b) ÷ 2; perimeter = a + b + c + d; from four sides: x = (c² − d² + (a − b)²) ÷ (2(a − b)), h = √(c² − x²).",
  "assumptions": [
    "a and b are the parallel sides (bases); c joins their left ends and d their right ends.",
    "All lengths are in the same unit; the area is in that unit squared."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "mode": {
        "title": "I know",
        "description": "Whether you know the two bases and the height, or all four sides.",
        "type": "string",
        "enum": [
          "height",
          "sides"
        ]
      },
      "a": {
        "title": "Base a (bottom)",
        "description": "The length of one of the two parallel sides.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000000
      },
      "b": {
        "title": "Base b (top)",
        "description": "The length of the other parallel side.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000000
      },
      "h": {
        "title": "Height h",
        "description": "The distance between the two bases, at right angles to them.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000000
      },
      "c": {
        "title": "Leg c (left)",
        "description": "The side that joins the left ends of the bases.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000000
      },
      "d": {
        "title": "Leg d (right)",
        "description": "The side that joins the right ends of the bases.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000000
      }
    }
  },
  "outputs": {
    "area": {
      "label": "Area",
      "description": "Half the sum of the bases times the height: (a + b) ÷ 2 × h.",
      "format": "number"
    },
    "median": {
      "label": "Midsegment",
      "description": "The line joining the midpoints of the legs: (a + b) ÷ 2.",
      "format": "number"
    },
    "perimeter": {
      "label": "Perimeter",
      "description": "The sum of the four sides: a + b + c + d.",
      "format": "number"
    },
    "height": {
      "label": "Height",
      "description": "The distance between the bases.",
      "format": "number"
    },
    "angleA": {
      "label": "Angle between a and c",
      "description": "The inside angle where base a meets leg c, in degrees.",
      "format": "number"
    },
    "angleB": {
      "label": "Angle between a and d",
      "description": "The inside angle where base a meets leg d, in degrees.",
      "format": "number"
    },
    "angleC": {
      "label": "Angle between b and c",
      "description": "The inside angle where base b meets leg c: 180° minus the angle at a and c.",
      "format": "number"
    },
    "angleD": {
      "label": "Angle between b and d",
      "description": "The inside angle where base b meets leg d: 180° minus the angle at a and d.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "mode": "height",
      "a": 10,
      "b": 4,
      "h": 4
    },
    "outputs": {
      "area": 28,
      "median": 7,
      "height": 4
    },
    "text": "A trapezoid with bases 10 and 4 and height 4 has an area of 28."
  },
  "examples": [
    {
      "given": {
        "mode": "height",
        "a": 14,
        "b": 11,
        "h": 6
      },
      "expect": {
        "area": 75,
        "median": 12.5
      },
      "source": "OpenStax, Prealgebra 2e, §9.4 Use Properties of Rectangles, Triangles, and Trapezoids, Example 9.38 (A = ½h(b + B): height 6, bases 14 and 11, area 75). https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids"
    },
    {
      "given": {
        "mode": "height",
        "a": 8.2,
        "b": 5.6,
        "h": 3.4
      },
      "expect": {
        "area": 23.46,
        "median": 6.9
      },
      "source": "OpenStax, Prealgebra 2e, §9.4, Example 9.40 (height 3.4 yd, bases 8.2 and 5.6 yd: 23.46 square yards). https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids"
    },
    {
      "given": {
        "mode": "sides",
        "a": 10,
        "b": 4,
        "c": 5,
        "d": 5
      },
      "expect": {
        "height": 4,
        "area": 28,
        "perimeter": 24,
        "angleA": 53.13010235415598,
        "angleC": 126.86989764584402
      },
      "source": "OpenStax, Prealgebra 2e, §9.4 (area of a trapezoid) and §9.3 (Pythagorean theorem). https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids; hand calculation in content.mdx: x = (25 − 25 + 36) ÷ 12 = 3, h = √(25 − 9) = 4, area = 7 × 4 = 28"
    },
    {
      "given": {
        "mode": "sides",
        "a": 7,
        "b": 3,
        "c": 3,
        "d": 5
      },
      "expect": {
        "height": 3,
        "area": 15,
        "angleA": 90,
        "angleB": 36.86989764584402
      },
      "source": "OpenStax, Prealgebra 2e, §9.4 (area of a trapezoid) and §9.3 (Pythagorean theorem). https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids; hand calculation in content.mdx: x = (9 − 25 + 16) ÷ 8 = 0, h = 3, area = 5 × 3 = 15"
    },
    {
      "given": {
        "mode": "height",
        "a": 10,
        "b": 4,
        "h": 4,
        "c": 5,
        "d": 5
      },
      "expect": {
        "area": 28,
        "perimeter": 24
      },
      "source": "OpenStax, Prealgebra 2e, §9.4 Use Properties of Rectangles, Triangles, and Trapezoids. https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids; hand calculation in content.mdx: (10 + 4) ÷ 2 × 4 = 28; 10 + 4 + 5 + 5 = 24"
    }
  ],
  "sources": [
    "OpenStax, Prealgebra 2e, §9.4 Use Properties of Rectangles, Triangles, and Trapezoids (area of a trapezoid A = ½h(b + B); Examples 9.38 and 9.40). https://openstax.org/books/prealgebra-2e/pages/9-4-use-properties-of-rectangles-triangles-and-trapezoids (retrieved 2026-10-01)",
    "OpenStax, Prealgebra 2e, §9.3 Use Properties of Angles, Triangles, and the Pythagorean Theorem. https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem (retrieved 2026-10-01)"
  ],
  "related": [
    "area",
    "triangle-area",
    "pythagorean-theorem"
  ],
  "changelog": []
}
