Skip to content
UseCalcNow
Finance

COGS Calculator — Calculate Cost of Goods Sold

Calculate cost of goods sold from beginning inventory, purchases, returns, and ending inventory, plus gross margin.

About This Calculator

Cost of goods sold is the number that connects your inventory purchases to your profit. This COGS calculator works from the standard periodic formula: beginning inventory, plus purchases, minus returns and allowances, minus ending inventory. Enter revenue as well and it reports gross profit and gross margin alongside the result. The explanation output walks through each step of the arithmetic so you can drop the numbers straight into your income statement.

The Formula Behind This Calculator

COGS = Beginning Inventory + Purchases − Purchase Returns & Allowances − Ending Inventory. Beginning inventory is the inventory balance at the period's opening. Purchases adds the invoice cost of goods bought for resale plus freight-in. Returns and allowances subtract supplier credits received during the period. Ending inventory removes the value of goods still on hand at close, which stays on the balance sheet as a current asset rather than becoming an expense. If you provide revenue, the calculator also derives gross profit (revenue − COGS) and gross margin (gross profit ÷ revenue × 100), the two figures lenders and investors read first.

Understanding the math helps you verify results and make better decisions for your project.

How to Use

  1. 1Enter the value of inventory on hand at the start of the period, taken from your prior balance sheet or last month's closing total.
  2. 2Add total purchases for the period including freight-in, then enter any supplier returns and allowances in their own field.
  3. 3Enter the ending inventory value from your physical count or perpetual system at period close.
  4. 4Optionally enter revenue to see gross profit and gross margin calculated from your COGS result.
  5. 5Read the result panel: COGS in dollars, with a margin breakdown in the explanation when revenue is provided.

When to Use

  • Closing monthly or annual books and preparing the gross profit line of an income statement.
  • Filing Schedule C or a corporate tax return, where COGS is a required deduction for product sellers.
  • Repricing products after supplier cost changes to check whether current margins still hold.
  • Preparing figures for a loan application, investor update, or business sale where gross margin gets scrutinized.

Tips

  • Count ending inventory on the last business day of the period; estimating it now and truing up later distorts the current period's COGS.
  • Include freight-in on purchases but keep outbound shipping to customers in selling expenses unless your accountant directs otherwise.
  • Track gross margin percentage monthly rather than only at year end, since supplier cost creep shows up there first.
  • Keep supplier invoices organized by receipt date so cutoff errors between periods stay out of both months.
  • Choose one inventory costing method, FIFO or weighted average, and apply it consistently across every period.

What Is Cost of Goods Sold?

Cost of goods sold, usually shortened to COGS, is the total direct cost of the products a business sells during a specific period. For a retailer that means the wholesale price paid for merchandise. For a manufacturer it covers raw materials, direct production labor, and factory overhead. On the income statement, COGS sits directly under revenue, and subtracting it from revenue produces gross profit.

The dividing line is direct traceability to production. Rent for a sales office, marketing spend, and admin salaries are operating expenses because they support the business generally. Depreciation on a production machine or freight charges on inbound materials tie directly to making product, so they belong in COGS. Getting this split right matters because it feeds the figures you would run through an accounting profit calculator when assembling full financial statements.

Timing is the other core rule. Costs only enter COGS when the goods are sold. Products still sitting on the shelf remain inventory, which is a current asset on the balance sheet rather than an expense. That is why an accurate ending inventory count is part of the formula, and why counting errors distort profit in both directions.

The COGS Formula Explained

The classic periodic formula reads: beginning inventory plus purchases, minus purchase returns and allowances, minus ending inventory. Beginning inventory is the value carried over from the close of the prior period. Purchases include the invoice cost of goods bought for resale plus freight-in. Returns and allowances are credits from suppliers, and ending inventory is what a physical count says is still on hand.

A worked example makes it concrete. Say a boutique opens the quarter with $10,000 in inventory, buys $45,000 of stock, receives $2,000 back in returns and allowances, and counts $12,000 on the shelf at quarter end. COGS equals 10,000 + 45,000 − 2,000 − 12,000 = $41,000. That is exactly the figure the calculator above computes from your four inventory inputs.

Dividing COGS by the number of units sold yields cost per unit, the number that drives almost every pricing decision. A unit price calculator extends the same logic when you sell in packs, cases, or varying weights. Comparing unit cost against unit selling price tells you whether a product line carries its weight before overhead even enters the picture.

Gross Margin and Markup Pricing

Gross profit is revenue minus COGS, and gross margin is that profit expressed as a percentage of revenue. Margins vary enormously by industry: grocery chains run near 25 percent, apparel retailers often exceed 50 percent, and software companies frequently top 80 percent because their marginal cost per copy is tiny. Enter your revenue in the field above and the calculator reports margin alongside COGS.

Markup and margin get confused constantly, and the confusion costs real money. A 50 percent markup on a $10 product produces a $15 selling price, which is only a 33.3 percent margin. To hit a 50 percent margin, that same product must sell for $20. The markup calculator handles this conversion so your pricing targets stay consistent whichever way you think about them.

Many independent retailers still use keystone pricing, doubling cost as a rough rule of thumb. That works until freight, platform fees, or shrinkage quietly eat the assumed 50 percent margin. Recalculating COGS quarterly keeps the floor under your prices honest, since every dollar of COGS reduction drops straight into gross profit.

How COGS Differs by Industry

Retail and wholesale businesses have the simplest COGS: what they paid suppliers for the merchandise sold. Manufacturing is messier, blending raw materials, direct labor, and factory overhead like electricity and equipment depreciation. Overhead allocation methods spread those shared costs across products, and comparing the allocation against your average fixed cost calculator output helps sanity-check the numbers before they land in COGS.

Service businesses often report minimal or zero COGS. A solo consultant selling hours has no goods to account for, while an agency deploying paid subcontractors may book their fees as cost of services. Restaurants track food and beverage costs closely, with most operators targeting a food cost of 28 to 35 percent of menu price, equivalent to a 65 to 72 percent gross margin.

Construction and project-based firms use job costing, assigning materials and labor to each project before totaling them into COGS as invoices go out. Whichever method fits your business, apply it consistently period over period, because mixed methods make trend lines meaningless and raise flags during an audit.

Inventory Valuation Methods Change the Result

The same physical inventory can produce different COGS depending on the costing method. FIFO assumes the oldest goods sell first, so in inflationary times it pushes older, cheaper costs into COGS and reports higher profit. LIFO does the reverse, matching recent expensive purchases against revenue for lower reported profit, and it is permitted under US GAAP but banned under IFRS.

Most small businesses use weighted average cost, which smooths price swings into a single blended cost per unit. Whatever method you choose, the IRS expects you to stick with it. Switching methods usually requires filing Form 3115 to request approval for the accounting change, which is a conversation best had with a CPA before year end.

Shrinkage from theft, damage, and spoilage flows through ending inventory: when a physical count comes in low, the missing value effectively lands in COGS. Cycle counting a few categories each week catches shrinkage early instead of surprising you at the annual count, and it keeps the ending inventory input of this calculator grounded in reality.

COGS on Your Tax Return

COGS is one of the largest deductions available to businesses that sell physical products, reducing taxable income dollar for dollar. The mechanics surprise some owners: purchasing inventory is not immediately deductible. The cost capitalizes into the inventory asset account and only converts to a deduction in the period the item sells.

Larger companies must navigate Section 263A uniform capitalization rules, which force certain indirect costs into inventory. Businesses averaging under roughly $25 million in annual gross receipts are exempt, which keeps small business bookkeeping far simpler. A tax professional can confirm where your situation falls, since the threshold adjusts with inflation.

Timing creates planning opportunities worth watching. A year-end inventory purchase shifts deductions into the following year when the goods sell, while selling down existing stock accelerates them. Modeling these movements in a cash flow calculator shows whether a pre-buy hurts liquidity more than it helps the tax bill.

Break Even and Profit Planning With COGS

Contribution margin, selling price minus variable cost per unit, feeds directly into break even analysis. Divide total fixed costs by contribution margin and you get the unit volume required to cover overhead. Run your COGS numbers through a break even calculator before committing to a new product line, a price cut, or a bulk inventory buy.

Trends matter as much as snapshots. When supplier prices creep up while your shelf prices hold flat, gross margin erodes a few points each quarter and the damage hides inside normal-looking revenue. Startups feel this acutely, so track how COGS trends feed into any burn rate calculator projection before the runway math surprises you.

Set a target gross margin for each product category and review actuals against it monthly. Products that consistently miss the target need repricing, renegotiated supply costs, or discontinuation. That discipline turns COGS from a bookkeeping output into an active management tool you can defend in any planning discussion.

Common COGS Mistakes That Distort Profit

The most frequent error is mixing operating expenses into COGS. Booking a marketing retainer or the owner's salary into cost of goods deflates gross margin and makes product-level economics look worse than they are. Lenders and investors read gross margin as a health signal, so this mistake damages credibility well beyond your internal numbers.

Period cutoff errors come in a close second. Goods received in early January but recorded as December purchases misstate both periods, and the error compounds every year it goes uncorrected. Reconcile supplier invoices against receiving dates before closing each month, especially around year end when the temptation to shift numbers peaks.

Clean COGS history also matters when you eventually sell the business. Buyers normalize earnings line by line, and sloppy cost of goods records invite price reductions or walked deals. Presenting several years of accurate margins strengthens the case in any business valuation calculator analysis a prospective buyer runs.

FAQ

Is COGS an expense or an asset?

Both, at different stages. Purchased inventory first sits on the balance sheet as a current asset. When the goods sell, their cost converts into the COGS expense on the income statement, which is why unsold stock never hits profit in the period you bought it.

Does COGS include salaries and wages?

Only wages tied directly to producing goods, such as factory labor on a production line. Sales commissions, administrative payroll, and marketing staff belong in operating expenses, not COGS.

Can I calculate COGS without a physical inventory count?

You need an ending inventory figure for an accurate result. The gross profit method can estimate it between counts, but for tax filings and year-end statements an actual count, or a reliable perpetual system balance, is the standard.

What is the difference between COGS and cost of sales?

The two terms get used interchangeably in most contexts. Some businesses apply cost of sales more broadly to cover the cost of delivering services as well as goods, while COGS is typically reserved for physical products.

What counts as a good gross margin?

It depends on the industry. Grocery stores operate around 25 percent, restaurants target 65 to 72 percent, apparel retailers often exceed 50 percent, and software companies frequently pass 80 percent. Benchmark against your own industry rather than a universal number.

Does shipping count toward COGS?

Inbound freight you pay to get goods onto your shelf belongs in COGS. Shipping you pay to send orders out to customers is usually classified as a selling expense, though many businesses pass those costs directly to buyers instead.

Related Calculators