{
  "schemaVersion": 1,
  "slug": "thread-count-calculator",
  "category": "fashion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "d9d68b88353899b88a563cb34252645d3419b325b404e004eebb726f1f33303a",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/thread-count-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "C = W + F; C_p = C × p",
    "vars": [],
    "note": "W: warp ends/in; F: weft picks/in; p: plies per yarn. Base count C = W + F. Ply-inclusive count C_p = C × p. Counting conventions vary; this is not a fabric quality rating."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "FTC staff opinion — thread count and plies",
        "url": "https://www.ftc.gov/legal-library/browse/advisory-opinions/american-textile-manufacturers-institute"
      }
    ],
    "basis": "Base thread count adds warp ends and weft picks per inch. The separate ply-inclusive total multiplies that sum by the number of plies; it must not be confused with base thread count. Fabric width and length determine estimated yarn counts across those dimensions, not softness or durability. Use measured counts and compare labels that use the same convention.",
    "limitations": "Use measured counts and compare labels that use the same convention.",
    "implementationHash": "d9d68b88353899b88a563cb34252645d3419b325b404e004eebb726f1f33303a",
    "domain": "lifestyle"
  },
  "contract": {
    "compute": "const base=tpi+ppi; const warp=tpi*width; const weft=ppi*length; return {threadCount:base,plyInclusiveCount:base*ply,warpThreads:warp,weftThreads:weft};",
    "inputs": [
      {
        "name": "tpi",
        "type": "number",
        "default": 200,
        "min": 10,
        "max": 1200,
        "step": 1,
        "slider": true
      },
      {
        "name": "ppi",
        "type": "number",
        "default": 200,
        "min": 10,
        "max": 1200,
        "step": 1,
        "slider": true
      },
      {
        "name": "width",
        "type": "number",
        "default": 90,
        "min": 5,
        "max": 200,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "length",
        "type": "number",
        "default": 100,
        "min": 5,
        "max": 500,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "ply",
        "type": "number",
        "default": 1,
        "min": 1,
        "max": 4,
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "threadCount",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "plyInclusiveCount",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "warpThreads",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "weftThreads",
        "precision": 0,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
