Free COGS calculator 2026. Calculate Cost of Goods Sold = beginning inventory + purchases - ending inventory. See gross profit and gross margin. Essential for income statement and tax.
Enter your Beginning Inventory ($)—the book value of merchandise, raw materials, and finished goods on hand at the start of the accounting period (matches prior period Ending Inventory).
Enter your Purchases & Direct Production Costs ($)—all inventory purchases, freight-in, customs duties, packaging, and direct manufacturing labor incurred during the period.
Enter your Ending Inventory ($)—the physical count value of unsold inventory remaining on hand at the close of the period.
Click "Calculate" to determine your Cost of Goods Sold (COGS) and Cost of Goods Available for Sale.
Cost of Goods Sold (COGS)—reported on IRS Form 1125-A and Schedule C Part III—captures the direct product, material, freight, and production labor costs attributable to the specific units actually sold during an accounting period. Under the GAAP matching principle, unsold inventory remains on the Balance Sheet as a Current Asset until the moment a customer buys it, at which point its cost transfers to COGS on the Income Statement.
An apparel brand starts Q1 with $45,000 in warehouse inventory. During Q1, it pays factories $145,000 for new inventory plus $15,000 in ocean freight and import tariffs ($160,000 total purchases). Goods Available for Sale = $45,000 + $160,000 = $205,000. A physical warehouse count on March 31 shows $55,000 in unsold inventory. Q1 COGS = $205,000 - $55,000 = $150,000. On $375,000 in Q1 revenue, Gross Profit is $225,000 (60.0% Gross Margin).
A workshop begins the year with $80,000 in timber and WIP inventory. It spends $220,000 on raw materials, $180,000 on direct assembly wages, and $40,000 on factory utilities ($440,000 total additions). Ending inventory is $70,000. Annual COGS = $80,000 + $440,000 - $70,000 = $450,000.
While software companies hold $0 physical inventory, GAAP SaaS COGS ("Cost of Revenue") includes AWS/GCP production hosting ($18,000/mo), OpenAI/Twilio embedded API usage ($9,000/mo), payment processing fees ($4,500/mo), and Tier-1 customer support & onboarding engineers ($13,500/mo), totaling $45,000/mo COGS on $250,000 MRR (18% COGS / 82% Gross Margin).
| Industry Sector | Typical COGS (% of Revenue) | Target Gross Profit Margin | Primary Cost Components in COGS |
|---|---|---|---|
| B2B SaaS & Cloud Software | 15% – 25% | 75% – 85% | Cloud hosting (AWS/GCP), 3rd-party APIs, CS onboarding, merchant fees |
| DTC Cosmetics & Supplements | 20% – 35% | 65% – 80% | Formulation, primary packaging, kitting, inbound freight |
| Apparel & Specialty E-Commerce | 38% – 52% | 48% – 62% | Garment manufacturing, customs/tariffs, inbound logistics, packaging |
| Restaurants & Food Service | 28% – 35% (Food/Bev) | 60% – 70% (Before Labor) | Raw food ingredients, beverage inventory, takeout packaging |
| Wholesale & Distribution | 72% – 85% | 15% – 28% | Bulk product procurement, inbound freight, warehouse handling |
| Supermarkets & Grocery Retail | 75% – 82% | 18% – 25% | Wholesale food/CPG cost, cold-chain freight, spoilage/shrinkage |
When supplier prices fluctuate throughout the year, how do you decide which unit cost leaves Ending Inventory and enters COGS? The IRS and GAAP permit three primary inventory costing methods: FIFO (First-In, First-Out), LIFO (Last-In, First-Out), and Weighted Average Cost.
In an inflationary environment where supplier costs are rising, FIFO assumes you sell your oldest, cheapest units first—which results in lower COGS, higher reported net income, and a higher Ending Inventory valuation on your balance sheet. Conversely, LIFO assumes you sell your newest, most expensive inventory first—increasing COGS and reducing taxable income, which saves cash taxes now.
Find answers to the most common questions about cogs calculator (cost of goods sold).
Under the GAAP and IRS matching principle, inventory purchases are an exchange of one asset (cash) for another asset (inventory). You only deduct the cost of inventory on your income statement (as COGS) in the period when the product is actually sold to a customer (or written off as damaged/obsolete).
COGS includes only the direct costs required to manufacture or purchase the products you sold (raw materials, wholesale stock, freight-in, direct factory labor). Operating Expenses (OpEx or SG&A—Selling, General, and Administrative) are the overhead costs required to run the business regardless of unit volume, such as office rent, marketing, accounting, R&D, and administrative salaries.
Because COGS equals Beginning Inventory + Purchases - Ending Inventory, any lost, stolen, or spoiled goods automatically reduce your physical Ending Inventory count—which increases your calculated COGS dollar-for-dollar and reduces your Gross Profit Margin.
Yes, often labeled "Cost of Revenue" or "Cost of Services." For agencies and consulting firms, COGS includes billable delivery salaries and subcontractor costs. For SaaS companies, COGS includes cloud server hosting, embedded third-party data/API costs, customer implementation/support, and credit card processing fees.
The figures and rules behind this calculator come from the publications below. Each link goes to the issuing agency, so you can check the current rate yourself.
Internal Revenue Service — Beginning inventory + purchases - ending inventory
Internal Revenue Service — Permitted inventory valuation methods (FIFO, LIFO, specific identification)
Results are estimates for planning and double-checking, not tax, legal or payroll advice. How we choose sources, how often rates are updated and how to report an error: editorial policy.
Cost of Goods Sold
$190,000.00
Revenue
$400,000.00
COGS
$190,000.00
Gross Profit
$210,000.00
Gross Margin
52.5%