SC

Cost of Goods Sold Calculator – COGS Formula, Gross Profit, Gross Margin & Inventory Cost

Cost of Goods Sold Calculator
Enter your beginning inventory, purchases, and ending inventory to instantly find your COGS, gross profit, gross margin, and markup — free online COGS calculator for any business.
No data stored
Instant results
Mobile friendly
100% free
Standard GAAP formula
Auto currency detection

Enter Your Inventory Details

Value of all goods you had in stock at the start of the period
All new inventory bought or manufactured during the period
Value of unsold goods remaining at the end of the period
Enables gross profit & margin calculation

Your COGS Breakdown

Enter your inventory numbers on the left and click Calculate COGS to see your full cost breakdown.

Cost of Goods Sold (COGS)
for this accounting period
Full Breakdown
Beginning Inventory
+ Purchases / Production
= Goods Available for Sale
− Ending Inventory
= Cost of Goods Sold

Cost vs. Profit Breakdown

Inventory Flow (Goods Available vs. COGS)

What Is Cost of Goods Sold?

Cost of goods sold (COGS) is the total direct cost of making or buying the products your business sold during a specific period. It is one of the most important numbers on any income statement.

COGS covers the actual cost of the inventory that left your shelves and went to customers. It does not include indirect costs like office rent, sales staff salaries, or marketing spend — those are called operating expenses and sit lower on the income statement.

Knowing your COGS helps you set the right prices, understand how profitable each sale is, and make smarter purchasing decisions. A rising COGS without a matching rise in revenue is a clear warning sign for any business owner.

The COGS Formula Explained

The standard accounting formula used worldwide is:

  • COGS = Beginning Inventory + Purchases − Ending Inventory

Beginning Inventory is what you had in stock at the start. You add everything you bought or produced during the period. Then you subtract what is still unsold at the end. What is left is the cost of everything you actually moved out the door.

Example: You start with $10,000 of goods, buy $25,000 more, and end the period with $8,000 unsold. Your COGS is $27,000.

Gross Profit & Gross Margin

Once you know COGS, you can quickly find two other vital metrics:

  • Gross Profit = Revenue − COGS
  • Gross Margin % = (Gross Profit ÷ Revenue) × 100
  • Markup % = (Gross Profit ÷ COGS) × 100

Gross margin tells you what share of each dollar of sales you keep before operating expenses. A 40% gross margin means for every $100 sold, $40 remains to cover overhead and profit.

IndustryTypical Gross Margin
Software / SaaS70 – 85%
Retail – Apparel45 – 60%
Retail – General25 – 45%
Restaurant / Food60 – 70%
Manufacturing20 – 40%
Wholesale / Distribution15 – 30%
Grocery / Supermarket20 – 30%

Inventory Valuation Methods

The method you use to value inventory directly changes your COGS — even with the exact same physical goods:

  • FIFO (First In, First Out): Oldest inventory is assumed sold first. In times of rising prices, FIFO gives lower COGS and higher profit.
  • LIFO (Last In, First Out): Newest inventory sold first. Gives higher COGS in rising markets, reducing taxable income. Note: LIFO is banned under IFRS (used outside the US).
  • Weighted Average: Averages the cost of all similar units. Smooth and consistent — good for businesses selling large volumes of identical items.
  • Specific Identification: Tracks the exact cost of each individual item sold. Best for high-value, unique goods like cars or jewelry.

Frequently Asked Questions

The standard COGS formula is: COGS = Beginning Inventory + Purchases − Ending Inventory. You start with what you already had, add everything new you bought or made during the period, then subtract what is still left unsold. The result is the cost of everything you actually sold to customers.
Gross profit is what you keep from your sales after paying for the goods themselves. The formula is: Gross Profit = Revenue − COGS. A higher gross profit means your pricing covers your product costs well. From gross profit, you then pay operating expenses like rent and salaries to arrive at net profit (the true bottom line).
COGS includes all direct costs tied to producing or purchasing goods. For retailers: the purchase price plus inbound freight. For manufacturers: raw materials, direct factory labor, and manufacturing overhead (power, machine depreciation). It does not include indirect costs like office rent, marketing, or management salaries.
In a rising-price environment, FIFO (First In, First Out) gives the lowest COGS because you assign the cost of your oldest (cheapest) inventory to goods sold. LIFO assigns the most recent (more expensive) cost and results in higher COGS. Weighted Average falls in between. In falling-price environments the relationship reverses.
For most purposes, yes. "Cost of goods sold" and "cost of sales" are used interchangeably on income statements. Service businesses often use "cost of sales" or "cost of revenue" because they don't sell physical goods. The calculation logic is the same: direct costs that go into delivering the product or service to the customer.
COGS is subtracted from revenue before calculating taxable income. A higher COGS means lower taxable income and lower taxes in the current period. This is one reason some US businesses use LIFO — it tends to produce higher COGS (and lower taxes) when costs are rising. Outside the US, LIFO is generally not allowed under IFRS, so businesses must use FIFO or Weighted Average.

COGS Dollar Amount by Revenue & COGS%

How much COGS to expect at different revenue levels and cost ratios.

Revenue ($) COGS 30% COGS 40% COGS 50% COGS 60% COGS 70%

Values show expected COGS at each revenue level for the given COGS-to-revenue percentage.

Gross Margin & Gross Profit by COGS

Find gross profit and margin for a range of revenues and COGS amounts.

Revenue ($) COGS ($) Gross Profit Gross Margin % Markup on Cost %

Gross Margin = (Revenue − COGS) ÷ Revenue × 100. Markup = (Revenue − COGS) ÷ COGS × 100.

Global Inventory Accounting Standards

How COGS rules differ by country and accounting framework.

Region / Standard LIFO Allowed? FIFO Allowed? Avg Cost? Notes
USA (US GAAP)YesYesYesOnly major economy permitting LIFO
EU / UK (IFRS)NoYesYesLIFO prohibited under IAS 2
Canada (ASPE/IFRS)NoYesYesIFRS adopted; LIFO not permitted
Australia (AASB)NoYesYesFollows IFRS; LIFO banned
India (Ind AS)NoYesYesConverged with IFRS standards
China (CAS)NoYesYesLIFO eliminated since 2007 reform
Japan (JGAAP)Yes*YesYesLIFO permitted but rarely used
Brazil (BR GAAP)NoYesYesAdopts IFRS framework

* Check current local regulations as rules may change. This table is for reference only.

Markup % vs. Gross Margin % Conversion Table

Markup is based on cost; margin is based on selling price. They are different numbers for the same profit.

Markup on Cost % Gross Margin % Sell Price if Cost = $100 Gross Profit if Cost = $100

Gross Margin = Markup ÷ (1 + Markup). Markup = Gross Margin ÷ (1 − Gross Margin). Always verify which formula your accounting system uses.

Average COGS % by Industry

Typical COGS-to-revenue ratios across different business types. Use these to benchmark your own numbers.

Industry Avg COGS % Avg Gross Margin % Key Cost Driver
Software / SaaS15 – 30%70 – 85%Hosting, support, licenses
Financial Services20 – 35%65 – 80%Transaction & servicing costs
Healthcare35 – 55%45 – 65%Medical supplies, direct staff
Restaurant / Food Service28 – 38%62 – 72%Food ingredients, kitchen labor
Retail – Apparel40 – 55%45 – 60%Product cost, import duties
Retail – Electronics65 – 80%20 – 35%High component cost, competition
Retail – Grocery70 – 80%20 – 30%Perishable goods, volume pricing
Manufacturing – Auto70 – 80%20 – 30%Raw materials, assembly labor
Manufacturing – Consumer55 – 70%30 – 45%Materials, factory overhead
Wholesale / Distribution70 – 85%15 – 30%Product acquisition cost
Construction65 – 80%20 – 35%Materials, subcontractors
E-commerce40 – 65%35 – 60%Product cost, fulfillment, returns

Ranges vary by company size, pricing strategy, and region. Use as a starting benchmark, not a hard rule.