garment-dhu-calculator
v1.0.1
Published
DHU (Defects Per Hundred Units) calculator for garment industry quality control. Daily QC metric used across the garment industry. Includes defect-type breakdown and daily aggregation across multiple checkers. Built and used in production by Scan ERP.
Maintainers
Readme
garment-dhu-calculator
DHU (Defects Per Hundred Units) calculator for garment industry quality control.
The standard daily QC metric used across CMT factories worldwide. Built and used in production by Scan ERP — a 100+ machine garment factory ERP that tracks DHU in real time from bundle-level damage reports.
Install
npm install garment-dhu-calculatorWhat is DHU?
DHU = (Total defects found / Total garments inspected) × 100
CRITICAL distinction: DHU counts defects, not defective pieces. One garment can have multiple defects — all are counted.
Example: A checker inspects 250 garments, finds 20 defective pieces with 35 total defects. DHU = (35 / 250) × 100 = 14
Usage
const {
calculateDHU,
calculateDHUByType,
aggregateDailyDHU,
classifyDHU,
} = require('garment-dhu-calculator');
// Basic DHU
calculateDHU({ defectsFound: 35, garmentsInspected: 250 });
// → 14
// DHU broken down by defect type
calculateDHUByType({
garmentsInspected: 250,
defectsByType: { 'broken-stitch': 12, 'sizing': 8, 'color-shade': 15 },
});
// → { total: 14, byType: { 'broken-stitch': 4.8, 'sizing': 3.2, 'color-shade': 6 }, totalDefects: 35 }
// Daily aggregate across multiple checkers
aggregateDailyDHU([
{ defectsFound: 12, garmentsInspected: 80, checker: 'Sita' },
{ defectsFound: 18, garmentsInspected: 120, checker: 'Ram' },
{ defectsFound: 5, garmentsInspected: 50, checker: 'Gita' },
]);
// → { totalDefects: 35, totalGarments: 250, dhu: 14, byChecker: { Sita: 15, Ram: 15, Gita: 10 } }
// Industry benchmark classification
classifyDHU(14); // → 'ACCEPTABLE'
classifyDHU(3); // → 'EXCELLENT'
classifyDHU(30); // → 'CRITICAL'Industry benchmarks
| DHU range | Classification | |-----------|----------------| | ≤ 5% | EXCELLENT | | ≤ 10% | GOOD | | ≤ 15% | ACCEPTABLE | | ≤ 25% | POOR | | > 25% | CRITICAL |
Related
- garment-aql-calculator — ISO 2859-1 AQL sampling
- garment-smv-calculator — SMV / SAM calculation
- garment-piece-rate — piece-rate payment
Try Scan ERP
This calculator is free. The full ERP that auto-computes DHU from every damage report on the factory floor — with photo evidence and severity classification — is at scanerp.pro.
- Live demo · 1.4M+ pieces tracked
- DHU benchmarks 2026
- Reduce rejection rate guide
- Free 30-day trial
License
MIT © Santosh Rijal / Scan ERP
