{
  "id": "square-footage",
  "version": "1d82824286b1",
  "status": "published",
  "name": "Square Footage Calculator",
  "question": "What is the square footage?",
  "summary": "Computes the area of a rectangle, circle, triangle or trapezoid, times how many, in square feet, square yards and square metres, with an optional cost.",
  "category": "construction",
  "url": "https://www.acalculator.org/construction/square-footage-calculator",
  "markdown": "https://www.acalculator.org/construction/square-footage-calculator.md",
  "kind": "function",
  "method": "area = area of the shape × how many; square yards = square feet ÷ 9",
  "assumptions": [
    "Rectangle: length × width. Circle: π × diameter² ÷ 4. Triangle: base × height ÷ 2. Trapezoid: (top + bottom) ÷ 2 × height.",
    "The area is the flat floor area. It adds nothing for waste or pattern matching.",
    "The cost is the area in the price unit × the price."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "shape": {
        "title": "Shape",
        "description": "The shape of the area.",
        "type": "string",
        "enum": [
          "rectangle",
          "circle",
          "triangle",
          "trapezoid"
        ]
      },
      "len": {
        "title": "Length",
        "description": "The length of the rectangle.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 100000
      },
      "wid": {
        "title": "Width",
        "description": "The width of the rectangle.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 100000
      },
      "dia": {
        "title": "Diameter",
        "description": "The diameter of the circle.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 100000
      },
      "base": {
        "title": "Base",
        "description": "The base of the triangle.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 100000
      },
      "h": {
        "title": "Height",
        "description": "The height of the triangle or trapezoid, measured at right angles to the base.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 100000
      },
      "a": {
        "title": "Top side",
        "description": "The first of the two parallel sides of the trapezoid.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 100000
      },
      "b": {
        "title": "Bottom side",
        "description": "The second of the two parallel sides of the trapezoid.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 100000
      },
      "qty": {
        "title": "How many",
        "description": "How many areas of this size.",
        "type": "integer",
        "minimum": 1,
        "maximum": 100000
      },
      "price": {
        "title": "Price",
        "description": "The price per square foot, square yard or square metre. Leave empty to skip the cost.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000
      },
      "per": {
        "title": "Price per",
        "description": "The area unit the price is for.",
        "type": "string",
        "enum": [
          "ft2",
          "yd2",
          "m2"
        ]
      }
    }
  },
  "outputs": {
    "squareFeet": {
      "label": "Area",
      "description": "The total area in square feet.",
      "format": "quantity",
      "unit": "ft2"
    },
    "squareYards": {
      "label": "Square yards",
      "description": "The total area in square yards (9 square feet each).",
      "format": "quantity",
      "unit": "yd2"
    },
    "squareMeters": {
      "label": "Square metres",
      "description": "The total area in square metres.",
      "format": "quantity",
      "unit": "m2"
    },
    "cost": {
      "label": "Cost",
      "description": "The total area in the price unit × the price.",
      "format": "money"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "shape": "rectangle",
      "len": 3.6576000000000004,
      "wid": 4.2672,
      "dia": 3.048,
      "base": 3.048,
      "h": 2.4384,
      "a": 1.8288000000000002,
      "b": 3.048,
      "qty": 1,
      "per": "ft2"
    },
    "outputs": {
      "squareFeet": 15.607710720000002,
      "squareYards": 15.607710720000002,
      "squareMeters": 15.607710720000002
    },
    "text": "The area is 168 ft²."
  },
  "examples": [
    {
      "given": {
        "shape": "rectangle",
        "len": 3.6576000000000004,
        "wid": 4.2672,
        "qty": 1,
        "per": "ft2",
        "price": 3.5
      },
      "expect": {
        "squareFeet": 15.607710720000002,
        "cost": 588
      },
      "source": "hand calculation in content.mdx: 12 × 14 = 168 ft²; × $3.50 = $588",
      "tolerance": 1e-12
    },
    {
      "given": {
        "shape": "circle",
        "dia": 3.048,
        "qty": 1,
        "per": "ft2"
      },
      "expect": {
        "squareFeet": 7.296587699003968
      },
      "source": "hand calculation in content.mdx: π × 10² ÷ 4 = 78.54 ft²"
    },
    {
      "given": {
        "shape": "triangle",
        "base": 3.048,
        "h": 2.4384,
        "qty": 2,
        "per": "ft2"
      },
      "expect": {
        "squareFeet": 7.4322432
      },
      "source": "hand calculation in content.mdx: 10 × 8 ÷ 2 = 40 ft²; × 2 = 80 ft²"
    },
    {
      "given": {
        "shape": "trapezoid",
        "a": 1.8288000000000002,
        "b": 3.048,
        "h": 2.7432000000000003,
        "qty": 1,
        "per": "yd2",
        "price": 30
      },
      "expect": {
        "squareFeet": 6.689018880000001,
        "squareYards": 6.68901888,
        "cost": 240
      },
      "source": "hand calculation in content.mdx: (6 + 10) ÷ 2 × 9 = 72 ft² = 8 yd²; × $30 = $240",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "NIST SP 811 (2008), Appendix B: 1 ft = 0.3048 m exactly, so 1 ft² = 0.09290304 m²; 1 yd = 3 ft."
  ],
  "related": [
    "cubic-yards",
    "concrete",
    "deck"
  ],
  "changelog": []
}
