Two of the most-used calculators are running below. No signup, no backend — the math runs in your browser.
🔍 AQL Sampling Calculator
ISO 2859-1:1999 Table II-A — used by every garment QC inspector globally. Cross-verified against QIMA's published reference.
Sample plan
Code letter —
Sample size —
Accept if defects ≤ —
Reject if defects ≥ —
Use in your own code
// Node.js
const { calculateAQL } = require('garment-aql-calculator');
const r = calculateAQL({ lotSize: 2400, inspectionLevel: 'GII', aql: 2.5 });
# Python
from garment_aql_calculator import calculate_aql
r = calculate_aql(lot_size=2400, inspection_level="GII", aql=2.5)
📊 DHU Calculator
Defects Per Hundred Units — the daily QC metric. Counts defects, not defective pieces (one piece can have many).
—% DHU
Formula —
Benchmark: ≤5% Excellent · ≤10% Good · ≤15% Acceptable · ≤25% Poor · >25% Critical
Use in your own code
// Node.js
const { calculateDHU } = require('garment-dhu-calculator');
calculateDHU({ defectsFound: 35, garmentsInspected: 250 }); // → 14
# Python
from garment_dhu_calculator import calculate_dhu
calculate_dhu(35, 250) # → 14.0
Each package is published on npm and PyPI as separate, independent libraries. MIT licensed.
garment-aql-calculator
ISO 2859-1 AQL sampling. Cross-verified against QIMA. 3-tier garment inspection support.
$ npm i garment-aql-calculator
$ pip install garment-aql-calculator
garment-dhu-calculator
DHU + breakdown by defect type, multi-checker daily aggregation, benchmark classification.
$ npm i garment-dhu-calculator
$ pip install garment-dhu-calculator
garment-line-efficiency
Sewing line efficiency %, target output reverse calc, required-worker planning, line balance / bottleneck analysis.
$ npm i garment-line-efficiency
$ pip install garment-line-efficiency
garment-fabric-consumption
Knit (GSM × area) and woven (marker length) methods. Wastage allowance, GSM ↔ oz/yd² conversion.
$ npm i garment-fabric-consumption
$ pip install garment-fabric-consumption
garment-cmt-cost
(SAM × CPM / Efficiency) + Trims + Pack. Country comparison (Bangladesh, India, Vietnam, USA, +9 more).
$ npm i garment-cmt-cost
$ pip install garment-cmt-cost
garment-smv-calculator
SMV / SAM stopwatch method with performance rating and allowance. Foundation for every other metric.
$ npm i garment-smv-calculator
$ pip install garment-smv-calculator
garment-piece-rate
Piece-rate earnings with quality bonus, speed bonus, overtime. Eliminates "supervisor calculated it wrong" disputes.
$ npm i garment-piece-rate
$ pip install garment-piece-rate
garment-bundle-id
Generate / parse bundle QR codes — STYLE-LOT-COLOR-SIZE-BUNDLE#-COMPONENT format with validation.
$ npm i garment-bundle-id
$ pip install garment-bundle-id