CalcFees
Inventory Method · Direct Method · Gross Profit

COGS Calculator

Two methods, one result. Use the inventory method if you track beginning and ending stock, or the direct method if you build what you sell. Add revenue to see gross profit and margin.

$
$

Raw materials, inventory, goods purchased for resale

$
$

Cost of Goods Sold

$27,000

Beginning inventory $10,000
+ Purchases $25,000
− Ending inventory $8,000
= COGS $27,000
Revenue $500K COGS $200K = Gross Profit $300K 60% margin OpEx $150K

How COGS Fits Into the Income Statement

COGS is the first deduction from revenue on every income statement, and its position is intentional — gross profit, which follows immediately, tells you whether the core production economics of the business are sound before a single dollar of overhead enters the picture. A business that cannot generate a positive gross margin has a fundamental cost-of-production problem that no amount of sales growth or overhead reduction will fix. One that generates strong gross margin but thin or negative net margin has an overhead problem, which is a different diagnosis with different solutions.

The inventory method is the starting point for most product businesses because it derives COGS from changes in inventory values rather than requiring a per-unit cost analysis. The formula — beginning inventory plus purchases minus ending inventory — captures the cost of everything sold during the period without requiring you to know the exact cost of each individual unit. The limitation is that it depends on accurate inventory counts and consistent cost accounting to be meaningful: a miscount or a valuation method change can distort the COGS figure without any corresponding change in actual production cost.

Direct Method: Building Up Cost From Components

The direct method constructs COGS from three inputs: direct materials (the raw inputs that become the product), direct labor (wages for production workers), and manufacturing overhead (factory rent, utilities, equipment depreciation allocated to production). This approach is standard for manufacturing and makes the cost structure visible in a way the inventory method does not — you can see immediately whether labor or materials are the dominant cost driver, which matters when you are deciding where to invest in efficiency improvements.

For ecommerce sellers, the direct method is often the practical choice because inventory tracking can be approximate but the cost of each product is known: wholesale cost plus inbound shipping plus any per-unit prep fees. Adding marketplace platform fees to the variable cost stack — available through our Amazon FBA calculator or Etsy fee calculator — and running the combined cost against price gives a more accurate COGS picture than inventory accounting alone. For a broader view of what remains after COGS, the profit margin calculator and break-even calculator run the downstream analysis.

Formula reference — May 2026:
  • • Inventory method: Beginning Inventory + Purchases − Ending Inventory = COGS
  • • Direct method: Direct Materials + Direct Labor + Manufacturing Overhead = COGS
  • • Gross Profit = Revenue − COGS
  • • Gross Margin % = (Gross Profit ÷ Revenue) × 100
  • • COGS Ratio % = (COGS ÷ Revenue) × 100

Frequently Asked Questions

What is cost of goods sold (COGS)?

Cost of goods sold is the direct cost of producing the products a business sold during a period — the materials, labor, and overhead that went specifically into the units that were actually sold (not the ones still sitting in inventory). COGS is subtracted from revenue to calculate gross profit, which is why it sits at the top of the income statement. A business with $500,000 in revenue and $200,000 in COGS has a $300,000 gross profit and a 60% gross margin. COGS does not include selling expenses, marketing, or general and administrative costs — those appear further down the income statement.

How do you calculate COGS using the inventory method?

The inventory method formula is: Beginning Inventory + Purchases During Period − Ending Inventory = COGS. It works because the units available for sale (beginning inventory plus new purchases) minus what is still on hand at period end must equal what was sold. If a business starts January with $10,000 in inventory, buys $25,000 in goods, and finishes January with $8,000 remaining, the $27,000 difference is the cost of the goods that left the shelf and generated revenue. Most small businesses use this method because it ties directly to the inventory accounts they already track.

What is the direct method for calculating COGS?

The direct method adds up the three categories of production cost — direct materials (raw inputs that become the product), direct labor (wages for workers who physically make the product), and manufacturing overhead (factory rent, equipment depreciation, utilities allocated to production). This method is standard for manufacturing businesses and any company that makes what it sells rather than reselling purchased goods. Service businesses generally do not calculate COGS at all because their costs are predominantly labor without inventory, though some use a "cost of revenue" line that serves the same gross-profit-calculation purpose.

What is gross profit margin and how does COGS affect it?

Gross profit margin is the percentage of revenue remaining after subtracting COGS: (Revenue − COGS) ÷ Revenue × 100. A 60% gross margin means 60 cents of every dollar in revenue is available to cover operating expenses and generate net profit. COGS is the primary driver because it is subtracted first — a 5% increase in material costs on a 40% gross-margin business drops gross margin to about 35%, which can make a profitable business unprofitable at the operating level without any change in overhead. Industry benchmarks vary widely: SaaS companies often run 70-80%+ gross margins, retail runs 20-40%, and food service frequently runs 30-40%.

What is the difference between COGS and operating expenses?

COGS covers only the direct costs of producing goods sold — materials, production labor, manufacturing overhead. Operating expenses cover everything else required to run the business: rent (for non-production space), marketing, sales commissions, software, accounting, insurance, and general administrative costs. The income statement separates them because gross margin (Revenue minus COGS) is a different business metric than operating margin (Revenue minus COGS minus operating expenses). A business can have a healthy 65% gross margin and still lose money at the operating level if overhead is high. The separation makes it easier to see exactly where margin is being consumed.

Can I add revenue to calculate gross profit?

Yes — the optional revenue field in this calculator unlocks the gross profit and gross margin calculations. Enter the total revenue for the same period as your COGS inputs and the calculator will show gross profit (Revenue − COGS), gross margin percentage, and a visual breakdown of how much of each revenue dollar went to cost versus profit. This is most useful when you are doing period-end analysis rather than prospective product pricing — for product-level margin math, the profit margin calculator handles the per-unit perspective.