npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kobolabs/garment-costing-formulas

v1.0.0

Published

Open costing models, margin formulas, and landed cost calculators for the apparel industry

Downloads

121

Readme

garment-costing-formulas

Open costing models, margin formulas, and landed cost calculators for the apparel industry.

License: MIT npm version

Why This Exists

Every fashion brand needs to cost garments, calculate margins, and understand landed costs. The formulas are well-known in the industry but rarely documented in a structured, machine-readable format. This dataset gives you the building blocks to calculate garment costs, set pricing, and build costing tools.

Costing Methods

| Method | Who Supplies Materials? | Brand Control | Typical Use | |--------|------------------------|---------------|-------------| | FOB (Free On Board) | Factory | Medium | Most common for Asia sourcing | | CMT (Cut, Make, Trim) | Brand | High | Premium brands sourcing own fabrics | | Full Package | Factory | Low | New brands, new categories |

FOB Breakdown

FOB Price
├── Fabric Cost (40-60%)          consumption_yards x price_per_yard
├── Trim Cost (5-15%)             sum(trim_qty x trim_unit_price)
├── CMT Labor (20-35%)            SAM x minute_rate x (1 + overhead%)
└── Factory Profit (5-15%)        subtotal x margin%

CMT Minute Rates by Country

| Country | Minute Rate | Typical Products | |---------|-------------|-----------------| | Bangladesh | $0.03-0.05 | Basic knits, woven shirts, fast fashion | | Cambodia | $0.03-0.05 | Casualwear, basic garments | | Myanmar | $0.02-0.04 | Basic cut & sew | | Vietnam | $0.05-0.08 | Outerwear, activewear, complex construction | | India | $0.04-0.07 | Embroidered, handwork, organic cotton | | Indonesia | $0.04-0.07 | Swimwear, denim, knitwear | | Pakistan | $0.03-0.05 | Denim, home textiles | | China (coastal) | $0.08-0.15 | Technical, complex, high-MOQ | | China (inland) | $0.05-0.09 | Mid-complexity, growing capacity | | Turkey | $0.08-0.12 | Denim, knitwear, fast-turn near-shore for EU | | Morocco | $0.07-0.10 | Near-shore for EU, basics and jersey | | Bulgaria | $0.07-0.10 | Near-shore EU, growing capacity | | Romania | $0.08-0.12 | Near-shore EU, mid-complexity | | Portugal | $0.15-0.25 | Premium, small-run, sustainable | | Italy | $0.25-0.50 | Luxury, tailoring, leather goods |

SAM (Standard Allowed Minutes) by Garment

| Garment | SAM Range | Notes | |---------|-----------|-------| | Basic T-Shirt | 8-12 min | Single jersey, minimal construction | | Hoodie | 15-22 min | Fleece, kangaroo pocket, hood | | Woven Shirt | 18-25 min | Button placket, collar, cuffs | | Jeans | 18-25 min | Denim, rivets, multiple pockets | | Basic Trouser | 14-20 min | Chino/cotton twill | | Simple Dress | 20-35 min | Depends heavily on construction | | Swimwear Bikini | 12-18 min | Elastic, lining, small pieces | | Down Jacket | 45-70 min | Baffles, zippers, complex assembly | | Tailored Jacket | 90-180 min | Canvas, lining, hand finishing | | Evening Gown | 120-240 min | Beading, draping, boning, hand work |

Landed Cost Formula

Landed Cost = FOB + Freight + Duty + Insurance + Brokerage + Handling
                    |          |       |           |           |
                    |          |       |           |           └─ $0.25-1.00/unit
                    |          |       |           └─ $150-400/shipment
                    |          |       └─ 0.3-0.5% of cargo value
                    |          └─ 0-32% of FOB (depends on HS code + origin)
                    └─ $0.15-0.50/unit sea, $2-8/unit air

Typical Breakdown

| Component | Share of Landed Cost | |-----------|---------------------| | FOB Price | 80-85% | | Freight | 3-8% | | Import Duty | 8-15% | | Insurance | 0.3-0.5% | | Customs Brokerage | 0.5-1% | | Warehouse Handling | 1-2% |

Margin Models

Wholesale

Landed Cost  ---[2.2-2.5x]-->  Wholesale Price  ---[2.0-2.5x]-->  Retail Price

Example:
$12.00 landed  -->  $28.00 wholesale (57% margin)  -->  $58.00 retail (52% margin)

Direct-to-Consumer

Landed Cost  ---[4.0-6.0x]-->  DTC Price

Example:
$12.00 landed  -->  $58.00 DTC price (79% gross margin)
                    - $25 CAC
                    - $6 shipping
                    - $2 packaging
                    - $1.68 payment processing
                    - 22% returns
                    = ~40-50% effective margin

Luxury

Landed Cost  ---[8-12x]-->  Retail Price

Example:
$45.00 landed  -->  $450.00 retail (90% gross margin)
Note: Pricing is perception-driven, not cost-driven.

Key Terms

| Term | Definition | |------|-----------| | Markup | Selling price / Cost (e.g., 2.5x) | | Gross Margin | (Selling price - Cost) / Selling price x 100 | | Keystone | Exactly 2.0x markup (50% gross margin) -- the minimum viable retail margin | | IMU | Initial Markup -- first markup before any markdowns | | MMU | Maintained Markup -- actual realized margin after markdowns and promotions |

Data Files

| File | Description | |------|-------------| | data/cost-structures.json | FOB, CMT, and Full Package models with formulas and components | | data/margin-models.json | Wholesale, DTC, and Luxury margin formulas with examples | | data/landed-cost-components.json | Freight, duty, insurance, brokerage, handling with rates and routes | | data/currency-pairs.json | 10 common sourcing currency pairs with volatility notes |

Quick Start

npm install @kobolabs/garment-costing-formulas
const costStructures = require('@kobolabs/garment-costing-formulas');

// Find the FOB model
const fob = costStructures.find(c => c.id === 'fob');
console.log(fob.formula);
// → "FOB = Fabric Cost + Trim Cost + CMT + Factory Overhead + Profit Margin"

Load individual files:

const margins = require('@kobolabs/garment-costing-formulas/data/margin-models.json');
const landed = require('@kobolabs/garment-costing-formulas/data/landed-cost-components.json');
const currencies = require('@kobolabs/garment-costing-formulas/data/currency-pairs.json');

// Get DTC hidden costs
const dtc = margins.models.find(m => m.id === 'dtc');
console.log(dtc.hiddenCosts);
// → [{ name: "Customer Acquisition", typical: "$15-40 per customer", ... }, ...]

Example Scripts

Landed Cost Calculator

node examples/landed-cost-calculator.js
node examples/landed-cost-calculator.js --fob 18 --origin china --destination us --quantity 3000
node examples/landed-cost-calculator.js --fob 12 --origin vietnam --destination us --quantity 5000 --weight 0.3

Margin Calculator

node examples/margin-calculator.js
node examples/margin-calculator.js --cost 15
node examples/margin-calculator.js --cost 8 --wholesale-markup 2.5 --retail-markup 2.2

Disclaimer

Rates and costs in this dataset are indicative estimates based on industry norms and publicly available data. They are provided for educational and planning purposes only. Actual costs vary significantly by volume, relationship, negotiation, season, and market conditions.

Always verify:

  • Duty rates with a licensed customs broker or the relevant tariff schedule
  • Freight rates with your freight forwarder (rates are volatile)
  • CMT rates directly with factories (rates change with minimum quantities, complexity, and relationship)

Contributing

See CONTRIBUTING.md for guidelines on adding costing models, updating freight rates, or expanding regional data.


Built by the team at Kobo -- modern PLM for fashion brands.