calculateCalculopedia
search

How to Calculate Cost of Sales (COGS)

calendar_monthPublished 2026-08-16verified_userReviewed by Calculopedia editorial

Ask a shop owner what their most important number is and they'll often mention revenue. But revenue means little without knowing how much it cost to generate. Cost of sales — also called cost of goods sold or COGS — is the direct cost of the products you actually sold during a period. Subtract it from revenue and you get gross profit, the first and most revealing measure of a business's health. Here's how to compute it correctly and why it underpins every pricing decision you'll ever make.

The formula

COGS = opening inventory + purchases − closing inventory

The logic is intuitive. Everything you could have sold this period is what you started with, plus what you bought, minus what's still sitting unsold at the end. Whatever remains after that subtraction is what left your shelves and reached customers.

Worked example

A store opens the year with ₹2,00,000 of stock, buys ₹8,00,000 more during the year, and ends with ₹1,50,000 still on hand:

Available for sale = 2,00,000 + 8,00,000 = ₹10,00,000
COGS = 10,00,000 − 1,50,000 = ₹8,50,000

If revenue for the year was ₹12,00,000:

Gross profit = 12,00,000 − 8,50,000 = ₹3,50,000

So of ₹12 lakh of sales, ₹8.5 lakh went to buying the goods — leaving ₹3.5 lakh to cover other expenses and, hopefully, become profit.

Why it matters

  • Gross margin = (revenue − COGS) ÷ revenue. It tells you how efficiently you buy and sell — a rising margin means healthier economics; a falling one means costs are eating you.
  • Tax — COGS is a deductible business expense, so getting it right reduces taxable profit lawfully. Businesses must keep opening/closing inventory and purchase records to support the figure.
  • Pricing — you cannot price profitably without knowing true unit cost; COGS is the floor below which a sale loses money.

Cost of sales in a service business

For service businesses there's no inventory, so COGS is usually the wages and materials directly tied to delivering the service — the engineer's time on a client project, the software license needed to fulfil it — rather than rent or general administration. The distinction is a little fuzzy in practice, which is why accounting norms give guidance on where to draw the line.

A note on inventory methods

Because prices change, there are different ways to value the inventory that flows into COGS. Two common ones are FIFO (first in, first out) and weighted average. In a rising-price year, the method you choose changes both COGS and gross profit — a detail accountants care about and a reminder that the same physical shelves can produce two different COGS figures on paper.

Common mistakes

  1. Forgetting the closing inventory — skipping it inflates COGS and understates profit (and can be flagged as inconsistent for tax).
  2. Folding non-direct costs into COGS — rent, marketing, and admin belong in operating expenses, not COGS, or your gross margin will mislead you.
  3. Mismatching periods — opening and closing inventory must be from the same period as the purchases and revenue.

Key takeaways

  • COGS = opening inventory + purchases − closing inventory.
  • Gross profit = revenue − COGS; gross margin is your efficiency scorecard.
  • COGS is the pricing floor — sell below unit cost and you lose on every order.
  • Services substitute direct labour/materials for inventory in the same role.

Work out your numbers with the Cost of Sales Calculator, then find how much you must sell to cover everything with the Break-Even Point Calculator.

FAQ

Is cost of sales the same as cost of goods sold?

Yes — the terms are used interchangeably. "Cost of sales" is broader in some usages because it can include direct labour (like installation), while COGS typically focuses on product cost. For most retailers they're effectively the same.

Do I count all my expenses in cost of sales?

No. Cost of sales covers only the direct cost of the goods or services sold. Operating expenses like rent, marketing, and salaries for non-fulfilment roles go below gross profit, not into COGS.

Why does my gross margin look low even though sales are rising?

Rising sales with a falling margin usually means costs are growing faster — higher purchase prices you haven't passed on, or more discounting. Track COGS as a percentage of sales over time, not just in rupees.