Skip to content

Cost of Goods Sold Calculator

Updated: 8 comments

Calculate Cost of Goods Sold (COGS) from your beginning inventory, purchases, and ending inventory. Enter the three values to find COGS for gross profit, pricing, and tax reporting.

COGS (Cost of Goods Sold) Calculator

Input Fields
BI
$
Value of inventory at the start of the period
P
$
Inventory purchased during the period
EI
$
Value of inventory remaining at the end of the period
If enabled, the result will update automatically when you change any value.

Cost of Goods Sold Formula

Formula
\[ \text{COGS} = \text{Beginning Inventory} + \text{Purchases} - \text{Ending Inventory} \]

Where:

  • \(\text{BI}\) — beginning inventory: the value of goods in stock at the start of the period ($)
  • \(\text{P}\) — purchases: the cost of inventory bought or produced during the period ($)
  • \(\text{EI}\) — ending inventory: the value of goods still in stock at the end of the period ($)

The formula captures a simple idea: whatever you started with, plus whatever you added, minus what is left over, must be what you sold. The result is the direct cost of the goods that left your shelves during the period.

Cost of Goods Sold – Calculation Example

Example: a retailer begins the quarter with $30,000 of inventory, buys $50,000 of additional stock during the quarter, and counts $25,000 of inventory remaining at the end.

\[ \text{COGS} = 30{,}000 + 50{,}000 - 25{,}000 \]

\[ \text{COGS} = 55{,}000 \]

Result: the cost of goods sold for the quarter is $55,000. If quarterly revenue was, say, $82,000, the gross profit would be $82,000 − $55,000 = $27,000.

How to Use the Calculator

  1. Enter the Beginning inventory — the value of goods on hand at the start of the accounting period, taken from your opening balance or prior period's ending inventory.
  2. Enter the Purchases — the total cost of inventory purchased (or, for manufacturers, produced) during the period, at cost rather than retail price.
  3. Enter the Ending inventory — the value of goods remaining in stock at the end of the period, usually from a physical count or perpetual inventory system.
  4. Read the Cost of Goods Sold result, expressed in dollars, below the inputs.

What Is Cost of Goods Sold?

Cost of Goods Sold (COGS) is the direct cost of the goods a business sells during an accounting period. For a retailer, it is the amount paid to suppliers for the merchandise sold. For a manufacturer, it includes raw materials, direct labor, and factory overhead tied to the finished goods sold. COGS appears on the income statement immediately below revenue and is subtracted from it to arrive at gross profit.

What COGS deliberately excludes is just as important as what it includes. Operating expenses such as rent, marketing, distribution, administrative salaries, and interest are not part of COGS — they are reported further down the income statement. Keeping these categories separate is what makes the gross profit margin meaningful as a measure of production or buying efficiency.

COGS matters for several practical reasons. It determines gross profit, which drives pricing and margin decisions. It affects taxable income, since a higher COGS means a lower reported profit and lower income tax. It also serves as a check on inventory management: if the calculated COGS does not match what your sales data suggests, it may indicate shrinkage, theft, miscounted stock, or accounting errors. Tools like the days in inventory and inventory stock calculators can extend this analysis.

Inventory Valuation Methods

The simple COGS formula works identically under any inventory costing method, but the numbers you plug into it depend on which method your business uses:

  • FIFO (First In, First Out): the oldest goods are sold first. In periods of rising prices this produces a lower COGS and higher profit. See the FIFO inventory cost calculator.
  • LIFO (Last In, First Out): the newest goods are sold first, producing a higher COGS when prices rise. Not permitted under IFRS, but allowed in the US under GAAP.
  • Weighted Average Cost: each unit is valued at the average cost of all units in stock, smoothing out price fluctuations.

Assumptions and Limitations

  • The calculator assumes all inventory changes come from purchases and sales. It does not separately track write-offs, shrinkage, returns to suppliers, or goods damaged in storage — these should be reflected in your ending inventory count or adjusted before entering it.
  • Enter all three values at cost, not retail price. Mixing a cost-based beginning inventory with a retail-value purchase total will distort the result.
  • The formula gives period totals, not unit-level detail. For product-by-product margins you need a per-SKU breakdown from your accounting or inventory system.
  • COGS is not the same as total expenses. Do not add shipping to customers, sales commissions, or marketing costs — these belong in operating expenses.
  • Consistency matters for tax purposes: once you choose an inventory valuation method, keep using it across periods unless you formally change it.

Practical Tips

  • Take a physical inventory count at the end of each period; an accurate ending inventory value is the single biggest source of COGS accuracy.
  • Remember that ending inventory of one period is the beginning inventory of the next — carry it forward unchanged.
  • Compare COGS to revenue as a percentage over time. A rising COGS ratio with flat prices suggests supplier costs are eating into your margins, which may call for repricing or renegotiation.
  • If you plan production or purchasing volumes, pair COGS with the economic order quantity and ending inventory calculators to plan stock levels.

Frequently Asked Questions

What is a good COGS-to-revenue ratio?

It varies sharply by industry. Grocery stores often run 70–75%, restaurants around 28–35% for food cost, clothing retailers 50–60%, and software companies can fall below 20%. The number to watch is the trend in your own gross margin: a COGS ratio that keeps climbing while your prices stay flat signals that supplier or production costs are squeezing profits. Benchmark against your industry only as a rough sanity check.

Does COGS include shipping, labor, and freight costs?

Inbound freight (the cost of getting goods to your warehouse) and direct labor used to produce goods are part of COGS. Outbound shipping to customers, sales commissions, marketing, and administrative salaries are not — they are operating expenses reported separately. A common mistake is adding delivery or payment processing fees into purchases, which inflates COGS and understates operating expenses.

Can COGS be negative or higher than revenue?

Mathematically the formula can return a negative number if ending inventory exceeds beginning inventory plus purchases — this almost always signals a data error, such as mixing retail and cost values or miscounting stock. COGS can legitimately exceed revenue when goods are sold below cost, producing a negative gross profit. If you see either result, recheck your inventory counts and valuation basis before reporting it.

Is COGS tax deductible?

Yes. COGS is deducted from revenue to determine gross profit, which lowers taxable income — that is why accurate inventory records matter at tax time. Because valuation method choice (FIFO, LIFO, or weighted average) changes the COGS figure, tax authorities require consistency between periods and formal disclosure of any method change. For anything beyond a simple retail operation, have an accountant review your COGS calculation before filing.

How do I calculate COGS if I only have sales records?

You cannot compute COGS accurately from sales alone, because sales are recorded at selling price while COGS uses cost. You need the three inventory values. If you know your markup or margin, you can approximate: for example, with a consistent 40% gross margin, COGS \(\approx 0.60 \times \text{revenue}\). Treat this only as an estimate — tax filings and financial statements require actual inventory figures at cost.

How often should I calculate COGS?

Small businesses typically compute it monthly or quarterly, aligning with accounting periods, and always annually for tax reporting. More frequent calculation helps spot problems early — rising supplier costs, shrinkage, or pricing mistakes show up as a shifting gross margin. Remember that each period's ending inventory becomes the next period's beginning inventory, so keeping a regular schedule keeps the chain of figures consistent.

What is the difference between COGS and cost of sales?

The two terms are often used interchangeably, and many income statements simply say 'cost of sales.' Where a distinction exists, COGS usually refers to the direct cost of physical goods, while cost of sales may be broader — for a service business it can include direct labor and project costs, where there is no inventory at all. Check which definition your accounting software or tax form uses and stay consistent.

Leave a Reply

Your email address will not be published. Required fields are marked *

8 thoughts on “Cost of Goods Sold Calculator”

  1. azu says:

    Following information has been extracted the books of leather product manufacturing company to prepare material ledger card for the month of January .
    January 1: Company had 50 meter leather sheet @ Rs 210.98 per meter
    January 4: Purchased material of 2,000 meter @ Rs 315 per meter
    January 13: Issued 1,000 meter material
    January 29: Issued 750 meter material

    Following information is related to direct labor cost
    Workers completed the assigned job to manufacture the leather product in the month of January based upon following information and the company observe the Halsey Premium plan.
    Wage rate per hour Rs 104
    Time allowed for the job 240 hours
    Time taken 176 hours

    Following cost incurred during the period to manufacture the product
    Factory overhead applied : Rs 45,000
    Closing finished goods: Rs 15,000
    Closing work in process: Rs 5, 000

    There was no beginning inventory in finished goods and work in process.

    Required:
    1. Prepare Material Ledger Card by using first in first out (FIFO) inventory valuation method under perpetual inventory system for the month of January.
    2. Calculate gross earnings of the workers for the month of January .
    3. Prepare Cost of Goods Sold Statement for the month of January.

  2. calcuing says:

    Cost calculators can help you see each step of the calculation. You just need to enter your unsolved math expressions and these calculators solve the calculations in seconds.

  3. Elena says:

    Why is freight in or freight out not included in this formula? Should it be? Some sources on the internet say yes & others say no. What is your opinion?

  4. Great tool!

  5. Kimberly Perkins, EA says:

    Does this work the same way for accrual tax returns? I have a CPA telling me I should no be deducting ending inventory or that I should be including the increase in inventory as part of the purchases. I can not find anything that says that and he wants me to amend three years of tax returns.

  6. Tariq says:

    How to account for free materials received and free utilities for which am not paying due to government subsidy

  7. Patrick Barnes says:

    Good formatting 👍🏿

  8. Tyrone says:

    To simple.. let's see a real heavy duty COGSC