Book a WhatsApp demo
Open Source · MIT licensed

Free Garment Industry Calculator Toolkit

8 production-tested calculators we use every day in our Nepal CMT factory. Use them online below, or install with one command — npm or pip.

8
packages
327
tests passing
2
languages (JS + Python)
Talk to the founder directly: WhatsApp +977-9704778917 Call now

Try them now — live in browser

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

More free calculators & templates

Each runs in your browser. No signup.

Marker efficiency calculator

Pattern area ÷ marker area × 100, with wasted area. Any units.

Fabric consumption calculator

Fabric per garment from the marker, plus the knit T-shirt kg/dozen method.

Garment cost sheet template

Live FOB cost sheet: fabric, trims, CM, overheads, profit. CSV download.

Inline inspection report format

Printable inline QC report with DHU and defect %. CSV download.

Sewing defects list

12 defects with causes, checks and major/minor class, plus real counts from one knit factory. CSV download.

Broken needle policy and record

Step-by-step procedure when a needle breaks, plus a printable needle record. CSV download.

Shrinkage test calculator and shade check

Length and width shrinkage % against your buyer's limits, with a shade check guide and test record. CSV download.

Cost per minute (CPM) calculator

Factory CPM and CM price per garment from your monthly cost.

SMV / SAM calculator

Observed time × rating × (1 + allowance), plus a garment builder.

Line efficiency calculator

(Pieces × SAM) ÷ (operators × minutes) × 100.

Piece-rate pay calculator

Operator piece-rate earnings and SAM-based targets.

AQL tables (ISO 2859-1)

Full sample size and accept/reject tables by lot size.

All 8 packages

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

Read the full announcement →

Want it all wired together?

These calculators are the math. Scan ERP is the rest — operator scanning, real-time WIP, payment automation, QC dashboards, and printer/biometric integration on a working CMT floor.

See Scan ERP →

Citing these calculators

Every formula here is open source and MIT licensed — inspect the implementation, verify the maths, and reuse it. The packages are published on npm and PyPI, so a result can be reproduced independently rather than taken on trust.

Copy this attribution

Scan ERP — Open-source garment factory calculators (SMV, DHU, line efficiency, fabric consumption, CMT cost, piece rate). https://scanerp.pro/tools/

Source: drmcoder/cmt-factory-toolkit (MIT). Last reviewed 26 September 2026.

Free reference tables: AQL sample sizes · stitch & seam types · needle sizes