Cost of Sales Calculator
Cost of sales (COGS) is what it costs you to make or buy the goods you sold — opening inventory + purchases − closing inventory — and subtracting it from revenue gives your gross profit.
verified_userReviewed by the Calculopedia editorial teamLast updated 2026-08-16
Embed on your site
Embed this calculator on your site:
<iframe src="https://calculopedia.darzh.xyz/embed/cost-of-sales-calculator/" width="100%" height="700" style="border:0;border-radius:12px" loading="lazy"></iframe>
quizExample
How this calculator works, with real numbers (no JavaScript needed):
Inputs
- Opening inventory
- 200000
- Purchases during the period
- 800000
- Closing inventory
- 150000
Results
- Cost of sales (COGS)
- ₹8,50,000
- Goods available for sale
- ₹10,00,000
- Opening inventory
- ₹2,00,000
- Purchases
- ₹8,00,000
- Closing inventory
- ₹1,50,000
functionsThe formula
Cost of sales — also called cost of goods sold (COGS) — is the direct cost of the products you sold during a period. Subtract it from revenue and you get gross profit, the first and most important profitability number for a business. Investors, lenders and tax authorities all start from this figure, because it tells you how efficiently you buy, make and sell — before overheads (rent, salaries, marketing) muddy the picture.
The formula
COGS = opening inventory + purchases − closing inventory
The logic is simple: everything you could have sold this period is what you started with plus what you bought, minus what you still have left.
Example
A store opens the year with ₹2,00,000 of stock, buys ₹8,00,000 more, and ends with ₹1,50,000:
Available for sale = 2,00,000 + 8,00,000 = ₹10,00,000
COGS = 10,00,000 − 1,50,000 = ₹8,50,000
So the goods that were actually sold cost ₹8,50,000. If revenue was ₹12,00,000, gross profit = ₹3,50,000 — a gross margin of about 29%.
Why it matters
- Gross margin = (revenue − COGS) ÷ revenue. It shows how efficiently you buy and sell. A margin that creeps down year after year is an early warning: suppliers are dearer, or you are discounting too often.
- Tax — COGS is a deductible business expense, so an accurate figure keeps your taxable profit honest and your books defensible.
- Pricing — you can't price profitably without knowing true unit cost. Most failing retail businesses underpriced because their COGS per unit was guessed, not counted.
Calculating COGS in different businesses
- A retailer buys finished goods and resells — purchases are the basic number, adjusted for stock in hand.
- A manufacturer must add the cost of raw materials used, plus factory labour that can be traced to production and production overheads such as power. This is where the simple formula gets built out into a full cost sheet.
- A service business typically has no inventory; its "cost of sales" is the wages and materials directly tied to delivering each service, not rent or admin.
Inventory valuation: same stock, different COGS
The formula needs the value of opening and closing inventory, and that value depends on the accounting method you follow:
- Weighted average — the common default for Indian businesses: a blended cost per unit smoothes out price swings.
- FIFO (first in, first out) — oldest stock is assumed sold first; closing inventory reflects the latest, usually higher, purchase prices.
- Specific identification — each item's actual cost, practical for large, distinct items like vehicles.
Whichever method you use, use it consistently. Switching arbitrarily changes COGS and smugly moves profit between periods.
Common mistakes
- Forgetting shrinkage. Theft, spillage, damage and expiry mean stock that left the shelf was not necessarily sold. A periodic stock count that feeds real closing values keeps COGS honest.
- Treating discounts as a marketing cost. A seasonal 20% discount directly reduces what you realize on each item; if buyers are taking it on core stock, it belongs in the margin conversation about COGS.
- Capital items in purchases. A new packaging machine is an asset with depreciation, not a batch of goods — booking it in purchases inflates COGS and distorts the period's gross profit.
- Ignoring GST. Track input GST separately on purchases so your COGS reflects the net cost, not the tax-inclusive bill.
For service businesses, cost of sales is usually wages and materials directly tied to delivering the service — not rent or admin.
helpFrequently asked questions
question_markHow do I calculate cost of sales?
Use the formula: cost of sales = opening inventory + purchases − closing inventory. For example, ₹2,00,000 + ₹8,00,000 − ₹1,50,000 = ₹8,50,000. The result is the direct cost of the goods you sold in the period.
question_markWhat is the difference between COGS and operating expenses?
COGS is the direct cost of producing or buying what you sell. Operating expenses (rent, marketing, admin) are indirect costs that keep the business running. COGS comes out of gross profit; operating expenses come out after it.
question_markWhy is cost of sales important?
It determines gross profit and gross margin — the core measure of how profitably you buy and sell — and it is a deductible expense for tax purposes. A falling margin is often the first sign of pricing or procurement problems.
question_markWhich inventory method should I use?
Indian businesses commonly use the weighted average method, which smoothes out purchase price swings. FIFO assumes oldest stock is sold first and shows newer (usually higher) prices in closing inventory. Use one method consistently — jumping between them misstates COGS and profit.