SScaleWin Start free
Free tool · D2C & Shopify

COGS Formula Calculator: Work Out Cost of Goods Sold

Use the COGS formula on your own numbers: get cost of goods sold, gross margin, COGS per unit and the break-even ROAS your ads must beat.

✓ Free · no signupBy Ajay KumarUpdated

Calculate your COGS

Currency
Which numbers do you have?
₹

Stock value at cost on day one.

₹

Stock bought or made in the period.

₹

Stock value at cost left on the last day.

Freight, returns, labour (optional)
₹

Shipping to your warehouse, customs, import fees.

₹

Money back from suppliers. This is subtracted.

₹

Only if you make your own products.

Sales in the same period
₹

Sales after discounts and returns.

units

Optional. Gives COGS per unit.

Cost of goods sold
₹8,50,000
Enter your numbers to see your COGS.
Gross profit—
Gross margin—
COGS per unit—
Break-even ROAS—
Formula with your numbers

Track COGS and true profit with ScaleWin →

Break-even ROAS here covers product cost only. Shipping to customers, payment fees and returns push it higher.

Calculated in your browser. Nothing you type is stored.

What is the COGS formula?

The COGS formula is Beginning Inventory + Purchases − Ending Inventory. Beginning inventory is the stock you had at the start of the period. Purchases is the net, landed cost of stock bought during it. Ending inventory is the stock left at the end. Example: ₹5,00,000 + ₹2,00,000 − ₹1,50,000 = ₹5,50,000 cost of goods sold.

COGS = Beginning Inventory + Purchases − Ending Inventory

COGS formula (with a worked example)

The COGS formula tells you what the stock you actually sold cost you over a period, such as a month, a quarter or a year. It sits on your P&L right under revenue, and every margin number below it depends on getting it right.

COGS = Beginning Inventory + Purchases − Ending Inventory
  • Beginning inventory (opening stock): the value of stock on hand on day one. It must equal last period's closing stock.
  • Purchases: the net, landed cost of stock bought during the period. This means after returns and discounts, plus freight and duty.
  • Ending inventory (closing stock): the value of stock left on the last day, from a physical count or your inventory system.

Worked example in ₹

  1. Opening stock on 1 April: ₹5,00,000
  2. Add net purchases for the quarter: ₹5,00,000 + ₹2,00,000 = ₹7,00,000. This is your cost of goods available for sale.
  3. Subtract closing stock on 30 June: ₹7,00,000 − ₹1,50,000 = ₹5,50,000 COGS

The same maths in $

Beginning inventory of $40,000 plus $25,000 of purchases gives $65,000 available. Subtract $30,000 of ending inventory and COGS is $35,000.

US tax filings use the same structure. IRS Form 1125-A adds beginning inventory, purchases, labour and other costs on lines 1 to 5. It then subtracts ending inventory on line 7 to give COGS on line 8.

COGS calculator: three ways to work it out

Not every business tracks stock the same way, so this cogs calculator gives you three methods in one card. Pick the one that matches the data you actually have.

MethodFormulaUse it when
InventoryBeginning + Purchases − EndingYou hold stock and count it, or your inventory app tracks it
Cost per unitCost per unit × Units soldYou know the landed cost of each item: D2C, dropship, print on demand
From your P&LRevenue × (1 − Gross margin %)You only have a P&L or a margin figure from your accountant

An advanced toggle lets you add freight and duties, purchase returns and direct labour. The default view keeps it to three inputs. Results include COGS, gross profit, gross margin, COGS per unit and break-even ROAS. You also see the formula filled in with your own numbers, and COGS as a % of revenue worked out step by step.

How to use the calculator above

  1. Choose your method: inventory, cost per unit, or revenue and gross margin.
  2. Pick your currency: ₹, $, £ or €. Rupee results use lakh and crore formatting, and you can type commas, such as 5,00,000.
  3. Type your own numbers over the example ones. Results update as you type.
  4. Open the advanced toggle if you need freight and duties, purchase returns or direct labour.
  5. Read the one-line verdict, plus any warning for negative COGS or selling below cost.
  6. Use 'Copy link' to save your method, currency and numbers in the URL, or 'Save as PDF' to print the result.

There is no sign-up, and nothing you type is sent anywhere.

What is included in COGS (and what isn't)

COGS should hold only the costs of getting sellable stock into your hands. IAS 2, the international standard for inventory, defines purchase cost in three parts. It is the purchase price, plus import duties, non-recoverable taxes, transport, handling and other directly attributable costs, minus trade discounts and rebates.

Include in COGSLeave out of COGS
Supplier or manufacturer priceGST or VAT you can claim back as input credit
Inbound freight and handlingMeta, Google and other ad spend
Import duties and customs feesRent, software and admin salaries
Packaging that is part of the productSelling and outbound distribution costs
Direct labour to make or assemble the productMachinery and equipment (these are capitalised and depreciated)

Net purchases, worked out

Net purchases = Purchase price + Freight-in + Duties + Non-recoverable taxes − Purchase returns − Trade discounts

Example: ₹2,00,000 of stock + ₹12,000 freight + ₹18,000 customs duty − ₹8,000 returned to the supplier − ₹4,000 trade discount = ₹2,18,000. Say you also paid ₹36,000 GST and can claim the input tax credit. That ₹36,000 stays out of COGS. The same logic applies to VAT in the UK, EU and Gulf, and to GST in Australia and South-East Asia, whenever you can reclaim it.

Grey areas for D2C

Some costs sit in a grey area: shipping to customers, payment gateway fees, pick-and-pack and COD charges. Many D2C brands keep them in a separate variable-cost line to work out contribution margin, rather than putting them in COGS. Either way can work for internal reports if you stay consistent. Ask your accountant how they want them treated in statutory accounts. In India, RTO units that come back sellable go back into stock. Damaged ones are a write-off.

How to calculate COGS without inventory (dropshipping and D2C)

If you dropship, or you think in unit economics, you don't need stock counts. Use landed cost per unit:

COGS = Landed cost per unit × Units sold

Dropship example in $

  1. Landed cost: $6.50 product + $3.20 supplier shipping + $1.30 duty = $11.00 per unit
  2. COGS: $11.00 × 1,200 units = $13,200
  3. Revenue at $29.99: 1,200 × $29.99 = $35,988
  4. Gross profit: $35,988 − $13,200 = $22,788, a 63.3% gross margin

That duty line matters more than it used to. US Customs and Border Protection suspended duty-free de minimis treatment for all countries from 29 August 2025. Parcels worth $800 or less now pay the duties, taxes and fees that apply to them. CBP reports collecting over $1 billion in duties on over 246 million low-cost shipments since the phase-out began. If you ship into the US, duty belongs in your landed cost.

D2C example in ₹

₹180 manufacturing + ₹22 packaging + ₹8 inbound freight to your warehouse = ₹210 per unit. Sell 3,000 units and COGS is ₹210 × 3,000 = ₹6,30,000.

Shopify cost per item

Shopify's 'Cost per item' field is meant for the price paid to the supplier, excluding taxes, shipping and other costs. Shopify also reports profit only for variants that had a cost set at the time of sale, according to Cogsy's guide. Many brands enter landed cost per unit instead, so Shopify's profit reports include freight and duty. Whichever you choose, fill in every variant. Otherwise your Shopify profit reports will show COGS too low. Check Shopify's help centre for the current wording.

Only have a P&L? How to calculate COGS from revenue

If your accountant gives you a P&L with a gross margin but no stock detail, work backwards:

COGS = Revenue × (1 − Gross margin %)
  • ₹ example: ₹50,00,000 revenue at 60% margin. ₹50,00,000 × (1 − 0.60) = ₹50,00,000 × 0.40 = ₹20,00,000 COGS.
  • £ example: £180,000 revenue at 45% margin. £180,000 × 0.55 = £99,000 COGS.

COGS as a % of revenue is simply 100 minus gross margin, so a 60% margin means 40% COGS. This shortcut is handy for planning with a Tally, Xero or QuickBooks P&L. It is only as accurate as the margin you put in.

COGS vs gross profit, gross margin and COGS per unit

Once you have COGS, four numbers follow. Using the ₹ example above, take revenue of ₹12,50,000, COGS of ₹5,50,000 and 2,200 units sold:

  1. Gross profit = Revenue − COGS = ₹12,50,000 − ₹5,50,000 = ₹7,00,000
  2. Gross margin = Gross profit ÷ Revenue × 100 = ₹7,00,000 ÷ ₹12,50,000 × 100 = 56%
  3. COGS % of revenue = ₹5,50,000 ÷ ₹12,50,000 × 100 = 44%. Check: 100 − 56 = 44.
  4. COGS per unit = ₹5,50,000 ÷ 2,200 = ₹250

Use net sales as revenue, meaning sales after discounts and returns. Gross sales will make your margin look better than it is. To go further, the Gross Margin Calculator works on price and cost. The Net Profit Calculator takes you down the full P&L to net profit.

From COGS formula to break-even ROAS for Meta and Google ads

Break-even ROAS is the revenue each unit of ad spend must bring in just to cover product cost. Take a 40% gross margin. Every ₹100 of sales leaves ₹40 to pay for ads, so you break even at 100 ÷ 40 = 2.5x.

Break-even ROAS = 1 ÷ Gross margin (as a decimal)
Gross marginCOGS %Break-even ROAS (Meta)Break-even ROAS (Google)
30%70%3.33x333%
40%60%2.5x250%
50%50%2.0x200%
56%44%1.79x179%
60%40%1.67x167%
70%30%1.43x143%

Google Ads defines target ROAS as conversion value ÷ ad spend × 100%, so 2.5x appears as 250%. Meta reports ROAS as a multiple. The 1 ÷ margin formula is a standard industry calculation, not an official Meta or Google formula.

Keep two cautions in mind. First, match the tax basis. If the purchase value your pixel sends includes GST or VAT, work out margin on a tax-inclusive price too. The Facebook Pixel Checker helps you look at your pixel setup. Second, break-even is a floor. It covers product cost only, not shipping, fees, salaries or rent, so set your real target above it with the ROAS Calculator. If you'd rather not redo this every week, ScaleWin tracks profit and ROAS against your margins every day across Meta and Google.

What is a good COGS percentage for a D2C brand?

There is no single good number. I couldn't find a reliable, sourced D2C benchmark that holds across categories, so I won't invent one. Apparel, beauty, supplements, electronics and food all run very different cost structures.

One thing is true for every brand. A lower COGS % means a higher gross margin, which means a lower break-even ROAS and more room to scale ads. At 70% COGS you need 3.33x just to break even. At 30% COGS you need 1.43x. If your margin is thin, the Price Calculator shows what price gets you to your target.

The calculator gives a one-line verdict based on gross margin levels for D2C brands. Treat it as a quick read, not a rule.

Warning signs the tool flags

  • Selling below cost: COGS is higher than revenue, so every sale loses money before ads.
  • Negative COGS: ending inventory is bigger than beginning inventory plus purchases. This is almost always a data error, such as a wrong stock count or a missed purchase bill.

FIFO, weighted average and LIFO: how they change COGS

When your buying prices change, the valuation method decides which cost goes into COGS. Say you buy 100 units at ₹200, then 100 more at ₹260, and you sell 120.

MethodMathsCOGS
FIFO (oldest first)100 × ₹200 + 20 × ₹260₹25,200
Weighted average(₹20,000 + ₹26,000) ÷ 200 = ₹230; 120 × ₹230₹27,600
LIFO (newest first)100 × ₹260 + 20 × ₹200₹30,000

When prices are rising, FIFO gives the lowest COGS and the highest profit. LIFO is allowed under US GAAP and IRS rules, but IAS 2 permits only FIFO or weighted average, plus specific identification for items that aren't interchangeable. That rules LIFO out in the UK, India (Ind AS 2), Australia, the Gulf and most of South-East Asia. Whatever you choose, use it every period, and make sure opening stock equals last period's closing stock.

COGS vs operating expenses (and cost of sales)

COGS rises and falls with the units you sell. Operating expenses (OpEx or SG&A) are the cost of running the business: rent, salaries, software, and marketing. Ad spend is OpEx, not COGS, even though it drives sales.

'Cost of sales' is the name most UK, Indian and IFRS reports use for the same line. Service businesses often use 'cost of revenue'. Gross profit sits between COGS and OpEx. Net profit is what remains after OpEx, interest and tax. The Profit Margin Calculator shows both margins side by side.

Common COGS formula mistakes

  • Leaving out purchases. Beginning minus ending inventory alone is not COGS. You must add what you bought in the period.
  • Using supplier price only. Freight, duty and handling belong in landed cost.
  • Adding capex or marketing. Machines are depreciated over time, and ads are OpEx.
  • Keeping reclaimable GST or VAT. If you get the input credit back, it is not a cost.
  • Not netting returns and discounts. Supplier returns and trade discounts reduce purchases.
  • Stale Shopify costs. Old or missing cost per item values make Shopify profit reports wrong.
  • Mismatched periods. Opening stock that doesn't match last period's closing stock breaks the whole calculation.

Track COGS-based profit every day, not once a quarter

ScaleWin connects your product costs to Meta and Google ad spend, so you can see each day whether your ROAS is above break-even.

Try ScaleWin free →

Frequently asked questions

What is the COGS formula?

COGS = Beginning Inventory + Purchases − Ending Inventory. Add the stock you started with to the net, landed cost of stock you bought, then subtract what is left at the end. For example, ₹5,00,000 + ₹2,00,000 − ₹1,50,000 = ₹5,50,000 cost of goods sold for the period.

Is shipping included in COGS?

Inbound shipping is included. That means freight to get stock from your supplier to your warehouse, which IAS 2 counts as part of purchase cost. Shipping orders out to customers is a selling cost. Many D2C brands track it as a separate variable cost for contribution margin instead of putting it in COGS.

Is advertising or marketing part of COGS?

No. Ad spend on Meta, Google or anywhere else is an operating expense, not COGS. COGS covers only the cost of the goods themselves and getting them ready to sell. Keeping ads out of COGS is what lets you compare gross margin with ROAS to find your break-even point.

Should GST or VAT be included in COGS?

Only if you cannot claim it back. IAS 2 includes taxes in purchase cost except those later recoverable from tax authorities. If you are GST-registered in India, or VAT-registered in the UK, EU or Gulf, and you claim input tax credit, leave that tax out of COGS.

How do I calculate COGS for dropshipping?

Multiply landed cost per unit by units sold. Landed cost is the product price plus supplier shipping, plus any duty or fees. For example, $11.00 landed cost × 1,200 orders = $13,200 COGS. For US customers, include duty, since duty-free de minimis was suspended from 29 August 2025.

What is break-even ROAS and how does COGS affect it?

Break-even ROAS is 1 ÷ gross margin. It is the ad return that just covers product cost. Higher COGS means a lower margin and a higher break-even. At 40% margin you need 2.5x (250% in Google Ads). At 60% margin you need 1.67x. Treat it as a floor, not a target.

Can COGS be negative?

Not in real life. A negative result means ending inventory came out bigger than beginning inventory plus purchases. That usually points to a data error: a wrong stock count, a missed purchase bill, or opening stock that doesn't match last period's closing stock. The calculator warns you when this happens.

Is LIFO allowed in India or the UK?

No. IAS 2, which the UK follows and which India mirrors in Ind AS 2, allows FIFO or weighted average cost, plus specific identification for items that aren't interchangeable. LIFO is mainly a US option, allowed under US GAAP and IRS rules.

Related free tools