Finance

How to Calculate COGS for Ecommerce Businesses

Read the complete guide below.

Launch Calculator

The Short Answer

COGS for ecommerce businesses includes all costs directly attributable to producing or acquiring the goods sold — product cost (FOB factory), inbound freight and duties, warehouse receiving and handling, outbound fulfillment costs (pick, pack, ship), and packaging materials. The formula is: COGS = Beginning Inventory + Purchases + Inbound Freight and Duties + Fulfillment Costs - Ending Inventory. Most ecommerce operators significantly understate COGS by omitting inbound logistics (which can add 8–15% to product cost for imported goods) and 3PL fulfillment fees (which add $3–$8 per order), resulting in overstated gross margins that misrepresent true product profitability. A correctly calculated ecommerce COGS typically produces gross margins 8–15 percentage points lower than a product-cost-only COGS calculation.

Understanding the Core Concept

The most common financial error in ecommerce accounting is an incomplete COGS definition. Some operators include only product cost (the invoice from the manufacturer), while others include product cost and outbound shipping but omit inbound freight, duties, and warehouse handling. Each omission overstates gross margin and understates the true cost of revenue — leading to incorrect pricing decisions, misleading investor reporting, and unit economics that do not reflect actual profitability.

Launch Calculator
Privacy First • Data stored locally

COGS Formula, Inventory Accounting Methods, and Period Allocation

The COGS formula operates at the period level (monthly, quarterly, or annually) rather than the per-unit level — integrating beginning inventory, purchases during the period, and ending inventory to calculate the cost of what was actually sold.

Real World Scenario

Overstating gross margin through incomplete COGS is not merely an accounting error — it leads to systematic business mistakes: underpricing products because the cost basis appears lower than it is, over-allocating marketing spend to unprofitable channels because contribution margin looks positive when it is not, and presenting misleading unit economics to investors who make valuation decisions based on reported gross margin.

Strategic Implications

Understanding these implications allows you to proactively manage your operational efficiency. Utilizing our specific tools provides the exact data points required to prevent margin erosion and optimize your strategic approach.

Actionable Steps

First, audit your current numbers using the calculator above. Second, identify the largest gaps between your actuals and the standard benchmarks. Third, implement a tracking system to monitor these metrics weekly. Finally, review your process every quarter to ensure you are continually optimizing.

Expert Insight

The biggest mistake companies make is relying on generalized industry data instead of their own precise calculations. When you map your exact costs and parameters into a standardized tool, you unlock compounding efficiencies that your competitors often miss.

Future Trends

Looking ahead, we expect margins to tighten as market pressures increase. The companies that build automated, real-time calculation workflows into their daily operations will be the ones that capture the most market share in the coming years.

Stop Guessing. Start Calculating.

Run the numbers instantly with our free tools.

Launch Calculator

Historical Context & Evolution

Historically, these calculations were done using rudimentary spreadsheets or expensive proprietary software, making it difficult for smaller operators to accurately predict costs. Modern, web-based tools have democratized this process, allowing immediate, precise calculations on demand.

Deep Dive Analysis

A rigorous analysis of this topic reveals that small percentage changes in these core metrics produce exponential changes in overall profitability. By standardizing your approach and continuously verifying against your specific constraints, you build a resilient operational model that can withstand market fluctuations.

3 Rules for Accurate Ecommerce COGS Calculation

1

Build a Per-SKU Landed Cost Model Before Setting Any Retail Price

Retail price should be set from a fully-loaded per-unit COGS basis, not from product cost alone. Before launching any product, build a per-SKU landed cost model that includes FOB cost, inbound freight allocation, duty rate, warehouse receiving, pick and pack, and average outbound shipping for your customer distribution. The fully-loaded COGS is the only rational basis for pricing decisions — and the MetricRig Profit Margin Calculator at /finance/unit-economics can model your target gross margin at different retail price points against a complete COGS build.

2

Reconcile COGS Monthly Against Physical Inventory Counts

COGS accuracy depends on inventory accuracy. If your recorded inventory balance is incorrect — due to receiving discrepancies, theft, damage write-offs, or system entry errors — your COGS will be incorrect regardless of how precisely you have defined your cost components. Conduct cycle counts on your top 20% of SKUs by revenue monthly and perform a full physical inventory count quarterly or semi-annually. The difference between book inventory and physical inventory that emerges from these counts represents shrinkage, which is a COGS adjustment — not an operating expense.

3

Build a Separate COGS Model for Each Sales Channel

A product sold DTC through your own Shopify store has different COGS than the same product sold through Amazon FBA — because outbound shipping, referral fees, and fulfillment costs differ by channel. A product sold wholesale to a retailer has different COGS than either direct channel. Building channel-specific contribution margin models (not just blended gross margin) reveals which channels are actually profitable at the unit level and which are generating revenue but losing money on every transaction. This analysis frequently reveals that Amazon channels appear profitable at a blended gross margin level but are contribution-margin negative after fully-loaded COGS — a discovery that is impossible to make from a single blended COGS line.

4

Automate Tracking Integrate your calculation process into your weekly operational review to spot trends early.

5

Validate Assumptions Check your base numbers against actual invoices and costs quarterly to ensure accuracy.

Glossary of Terms

Metric

A standard of measurement.

Benchmark

A standard or point of reference.

Optimization

The action of making the best use of a resource.

Efficiency

Achieving maximum productivity with minimum wasted effort.

Frequently Asked Questions

Standard GAAP practice and SEC guidance for public ecommerce companies classify outbound shipping as a cost of revenue (COGS) because it is a direct variable cost incurred to complete each revenue transaction. Most authoritative ecommerce accounting frameworks (including guidance from major ecommerce-specialized accounting firms) follow this classification. However, GAAP does provide some flexibility in how costs are classified as long as the methodology is disclosed and consistently applied. For management reporting purposes, including outbound shipping in COGS is essential for accurate gross margin analysis — it reveals the true contribution of each product and channel. For tax purposes, the classification affects which income statement line items are impacted but does not change total taxable income.
Inventory write-downs — reducing the book value of inventory that is obsolete, slow-moving, damaged, or worth less than its recorded cost — are recognized as a COGS adjustment in the period the write-down occurs. Under the lower of cost or net realizable value (LCNRV) rule in ASC 330, inventory must be written down to its estimated net realizable value when that value falls below cost. For ecommerce operators, common triggers include: seasonal products held beyond their selling season, products with significant Amazon review damage, discontinued SKUs, and products affected by tariff changes that make them uncompetitive at current retail prices. Write-downs should be disclosed separately from normal COGS in your management reports so gross margin trends are not obscured by one-time inventory adjustments.
Merchant processing fees — typically 2.9% + $0.30 per transaction for Stripe and PayPal standard rates — are variable costs directly tied to each revenue transaction, which gives them a strong argument for COGS inclusion. However, standard US GAAP practice and most ecommerce accounting frameworks classify merchant processing fees as a G&A or operating expense rather than COGS, primarily because they are a cost of collecting payment rather than a cost of the product itself. For management reporting and unit economics analysis, including merchant processing fees in your contribution margin calculation is important — a product with a $2.00 gross profit per unit that costs $0.92 in payment processing has almost no contribution margin to cover customer acquisition. Whether you book it in COGS or operating expenses, the contribution margin model should always include it.
By optimizing this metric, you directly improve your operational efficiency and bottom line margins.
Yes, these represent standard best practices, though exact figures will vary by your specific market conditions.

Disclaimer: This content is for educational purposes only.

Related Topics & Tools

Accounts Receivable Turnover Benchmarks for 2026

The accounts receivable (AR) turnover ratio measures how many times per year a business collects its average receivables balance. Calculate it by dividing net credit sales by average accounts receivable. A ratio of 8 means you collect your entire receivables balance roughly every 45 days. Industry benchmarks range from 5–7 for construction and manufacturing to 10–15 for retail and SaaS — the higher the ratio, the faster cash is converting from invoices into your bank account.

Read More

Annual vs Monthly SaaS Plans: Revenue and Churn Impact

Annual SaaS plans reduce churn by 50–70% compared to monthly plans, improve LTV by 2–4x, accelerate CAC payback, and improve cash flow predictability — but at the cost of lower new subscriber conversion rates and higher upfront customer commitment barriers. Monthly subscribers churn at 4–9% monthly in typical SMB SaaS; annual subscribers churn at 3–8% annually (at renewal). The revenue math almost always favors pushing customers toward annual plans, typically offered at a 10–20% discount. Use the MetricRig Churn Rate Calculator at /finance/churn to model how shifting your annual plan mix affects net revenue retention and LTV.

Read More

SBA Loan vs Conventional Business Loan: 2026 Comparison

The fundamental difference between an SBA loan and a conventional business loan is the SBA guarantee: on SBA 7(a) loans, the Small Business Administration guarantees 75 to 85% of the loan balance, which allows banks to lend to businesses that do not qualify for conventional financing. SBA loans offer longer repayment terms (10 to 25 years versus 3 to 7 years for most conventional loans), lower down payment requirements (10 to 20% versus 20 to 30%), and competitive rates (Prime + 2.25 to 4.75%, approximately 10 to 13% total in 2026), but they require significantly more documentation and take 30 to 90 days to close versus 7 to 21 days for conventional business loans. For businesses with strong financials, conventional loans are faster and have fewer restrictions; for businesses that need maximum term length, minimum down payment, or SBA-specific programs like USDA Rural or SBA 504 for real estate, SBA is the better structure.

Read More

Break-Even Analysis: Formula and Real Examples

Break-even analysis determines the sales volume or revenue level at which total revenue equals total costs — generating neither profit nor loss. The break-even unit formula is: Break-Even Units = Fixed Costs / (Selling Price - Variable Cost Per Unit), and the break-even revenue formula is: Break-Even Revenue = Fixed Costs / Contribution Margin %. A business with $120,000 in monthly fixed costs, a $75 selling price, and $32 in variable costs per unit needs to sell 2,791 units per month to break even — or generate $209,302 in monthly revenue. Any sales above this threshold generate profit; any below generate a loss.

Read More

Startup Burn Rate Benchmarks by Stage 2026

A healthy monthly net burn rate for a pre-seed startup in 2026 is $15,000 to $40,000; for a seed-stage company, $50,000 to $150,000; and for a Series A company, $250,000 to $600,000. These ranges assume the burn is generating proportional ARR growth — the burn multiple (net burn / net new ARR added) is the more important metric, and a burn multiple below 1.5x is considered excellent at any stage. Net burn is calculated as total cash out minus total cash in per month. A company burning $200,000 per month with zero revenue has a gross and net burn of $200,000; one burning $200,000 but generating $80,000 in revenue has a net burn of $120,000. Use the Startup Runway Calculator at metricrig.com/finance/burn-rate to calculate your current burn rate and project your zero-cash date.

Read More

How to Calculate Months of Runway

Months of runway is calculated by dividing your current cash balance by your net monthly burn rate: Runway = Cash Balance / Net Monthly Burn. Net monthly burn is gross operating expenses minus cash revenue collected during the month — not billed, not accrued, but actually received in your bank account. For example, a company with $3,600,000 in cash, $300,000 in monthly expenses, and $60,000 in monthly collected revenue has a net burn of $240,000 and exactly 15 months of runway. Use the free Startup Runway Calculator at metricrig.com/finance/burn-rate to compute your number instantly and model forward scenarios without building a spreadsheet from scratch.

Read More