{
  "id": "yardage",
  "version": "49b5fa0a6b6d",
  "status": "published",
  "name": "Fabric Yardage Calculator",
  "question": "How much fabric yardage do I need?",
  "summary": "Works out how many yards (or meters) of fabric to buy for a number of same-size pieces, from the piece size, the fabric width and an allowance for shrinkage, rounded up to 1/8 yard.",
  "category": "everyday-life",
  "subcategory": "clothing",
  "url": "https://www.acalculator.org/everyday-life/yardage-calculator",
  "markdown": "https://www.acalculator.org/everyday-life/yardage-calculator.md",
  "kind": "function",
  "method": "Across = ⌊fabric width ÷ piece width⌋; rows = ⌈pieces ÷ across⌉; length = rows × piece length × (1 + extra ÷ 100); yards = inches ÷ 36, rounded up to 1/8 yard (meters = cm ÷ 100, rounded up to 0.1 m).",
  "assumptions": [
    "All pieces are the same rectangle, cut in rows straight across the fabric with no turning and no pattern repeat.",
    "The piece sizes already include seam allowances; the fabric width is the usable width.",
    "Fabric is bought in 1/8 yard steps (inches) or 0.1 m steps (centimeters)."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "u": {
        "title": "Measure in",
        "description": "Inches (buy by the yard) or centimeters (buy by the meter).",
        "type": "string",
        "enum": [
          "in",
          "cm"
        ]
      },
      "n": {
        "title": "Number of pieces",
        "description": "How many pieces of this size you will cut.",
        "type": "integer",
        "minimum": 1,
        "maximum": 1000
      },
      "pl": {
        "title": "Piece length",
        "description": "The length of one piece, along the fabric (down the bolt), with seam allowances.",
        "type": "number",
        "minimum": 0.01,
        "maximum": 10000
      },
      "pw": {
        "title": "Piece width",
        "description": "The width of one piece, across the fabric, with seam allowances.",
        "type": "number",
        "minimum": 0.01,
        "maximum": 10000
      },
      "fw": {
        "title": "Fabric width",
        "description": "The usable width of the fabric from selvage to selvage; 44 in and 54 in are common.",
        "type": "number",
        "minimum": 0.01,
        "maximum": 10000
      },
      "x": {
        "title": "Extra for shrinkage",
        "description": "Length to add for shrinkage, straightening and mistakes.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 100
      }
    }
  },
  "outputs": {
    "buy": {
      "label": "Fabric to buy",
      "description": "The length needed, rounded up to the next 1/8 yard, or 0.1 m for centimeters.",
      "format": "text"
    },
    "yards": {
      "label": "Yards needed",
      "description": "The exact length needed, in yards (36 in each).",
      "format": "number"
    },
    "meters": {
      "label": "Meters needed",
      "description": "The same length in meters.",
      "format": "number"
    },
    "lengthNeeded": {
      "label": "Length needed (in your unit)",
      "description": "Rows × piece length, plus the extra percent, in inches or centimeters.",
      "format": "number"
    },
    "across": {
      "label": "Pieces across the width",
      "description": "How many pieces fit side by side: fabric width ÷ piece width, rounded down.",
      "format": "integer"
    },
    "rows": {
      "label": "Rows",
      "description": "Pieces ÷ pieces across, rounded up.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "u": "in",
      "n": 4,
      "pl": 22,
      "pw": 18,
      "fw": 44,
      "x": 10
    },
    "outputs": {
      "buy": "1 3/8 yd",
      "yards": 1.3444444444444446,
      "meters": 1.22936,
      "lengthNeeded": 48.4,
      "across": 2,
      "rows": 2
    },
    "text": "Buy 1 3/8 yd of fabric for 4 pieces."
  },
  "examples": [
    {
      "given": {
        "u": "in",
        "n": 4,
        "pl": 22,
        "pw": 18,
        "fw": 44,
        "x": 10
      },
      "expect": {
        "buy": "1 3/8 yd",
        "yards": 1.3444444444444446,
        "lengthNeeded": 48.4,
        "across": 2,
        "rows": 2,
        "meters": 1.22936
      },
      "source": "hand calculation in content.mdx: 2 across, 2 rows, 44 in × 1.1 = 48.4 in = 1.344 yd, up to 1 3/8 yd; NIST Handbook 44 (2026), Appendix C, General Tables of Units of Measurement (1 yard = 3 feet = 36 inches; 1 inch = 2.54 centimeters exactly), https://www.nist.gov/document/2026-nist-handbook-44-appendix-c (retrieved 2026-10-02)"
    },
    {
      "given": {
        "u": "cm",
        "n": 6,
        "pl": 50,
        "pw": 40,
        "fw": 150,
        "x": 0
      },
      "expect": {
        "buy": "1 m",
        "meters": 1,
        "yards": 1.0936132983377078,
        "across": 3,
        "rows": 2,
        "lengthNeeded": 100
      },
      "source": "hand calculation in content.mdx: 3 across, 2 rows, 100 cm = 1 m; 100 ÷ 91.44 yd; NIST Handbook 44 (2026), Appendix C, General Tables of Units of Measurement (1 yard = 3 feet = 36 inches; 1 inch = 2.54 centimeters exactly), https://www.nist.gov/document/2026-nist-handbook-44-appendix-c (retrieved 2026-10-02)"
    },
    {
      "given": {
        "u": "in",
        "n": 1,
        "pl": 36,
        "pw": 44,
        "fw": 44,
        "x": 0
      },
      "expect": {
        "buy": "1 yd",
        "yards": 1,
        "across": 1,
        "rows": 1
      },
      "source": "hand calculation in content.mdx: one 36 in piece the full width is exactly 1 yard; NIST Handbook 44 (2026), Appendix C, General Tables of Units of Measurement (1 yard = 3 feet = 36 inches; 1 inch = 2.54 centimeters exactly), https://www.nist.gov/document/2026-nist-handbook-44-appendix-c (retrieved 2026-10-02)"
    },
    {
      "given": {
        "u": "in",
        "n": 10,
        "pl": 10.5,
        "pw": 15,
        "fw": 54,
        "x": 5
      },
      "expect": {
        "buy": "1 1/4 yd",
        "yards": 1.225,
        "lengthNeeded": 44.1,
        "across": 3,
        "rows": 4
      },
      "source": "hand calculation in content.mdx: 3 across, 4 rows, 4 × 10.5 = 42 in, × 1.05 = 44.1 in = 1.225 yd, up to 1 1/4 yd; NIST Handbook 44 (2026), Appendix C, General Tables of Units of Measurement (1 yard = 3 feet = 36 inches; 1 inch = 2.54 centimeters exactly), https://www.nist.gov/document/2026-nist-handbook-44-appendix-c (retrieved 2026-10-02)"
    }
  ],
  "sources": [
    "NIST Handbook 44 (2026), Appendix C, General Tables of Units of Measurement (1 yard = 3 feet = 36 inches; 1 inch = 2.54 centimeters exactly, so 1 yard = 0.9144 meter). https://www.nist.gov/document/2026-nist-handbook-44-appendix-c (retrieved 2026-10-02)"
  ],
  "related": [
    "circle-skirt",
    "unit-price"
  ],
  "changelog": []
}
