Cost of goods sold calculator

Calculate cost of goods sold (cost of sales), gross profit and gross margin for a period from your inventory, purchases and direct labor.

In shortCOGS = beginning inventory + purchases + freight-in + direct labor − ending inventory. Gross profit = revenue − COGS. Gross margin = gross profit ÷ revenue.

Calculator

Production or prep labor, if you include it

Enter your numbers and press Calculate.

The math behind the cost of goods sold

COGS = beginning inventory + purchases + freight-in + direct labor − ending inventory.

Gross profit = revenue − COGS.

Gross margin % = gross profit ÷ revenue × 100.

Inventory turnover = COGS ÷ ((beginning + ending inventory) ÷ 2).

Cost of goods sold with real numbers

A small food producer starts the month with $18,000 of inventory, buys $42,000 of ingredients and packaging, pays $1,200 freight and $15,000 of production labor, and ends with $16,500 in stock. COGS is $59,700. On revenue of $110,000, that is 54.3% of revenue, leaving $50,300 gross profit, a 45.7% gross margin.

Fictional numbers for illustration only.

When a cost of goods sold helps

Cost of goods sold, also called cost of sales, is what it cost you to produce or buy the products you sold in a period. It sits right under revenue on the income statement, and it decides your gross margin before rent, marketing and admin.

For restaurants, bakeries, retailers and small manufacturers, the most controllable parts are purchasing and direct labor. Run this monthly with a physical inventory count to spot drift early. Your accountant decides which costs belong in COGS for tax purposes.

Where the ending inventory figure comes from

The calculator treats ending inventory as a number you already have, but that number decides the whole result. Every dollar you overstate in ending inventory comes straight off COGS and shows up as extra gross profit. Most small businesses get it in one of two ways:

Whichever you use, count at the same point in the cycle each time, such as after close on the last day of the month, and value items at what you paid, not at the selling price.

FIFO or average cost: the same sale, two answers

When purchase prices change during the period, the costing method changes COGS. The IRS lists the accepted inventory methods in Publication 538 and asks for the method you use on Form 1125-A. Here is the effect on one product line.

One product, 220 units sold (fictional figures)
Item FIFO Weighted average
Beginning stock 100 units at $4.00 100 units at $4.00
Purchased 200 units at $4.50 200 units at $4.50
Cost per unit used Oldest first: 100 at $4.00, then 120 at $4.50 $1,300 ÷ 300 = $4.33
COGS $940.00 $953.33
Ending inventory 80 at $4.50 = $360.00 80 at $4.33 = $346.67

Both columns add up to the same $1,300 of goods available. FIFO puts more of it into ending stock when prices are rising, so COGS is lower and gross profit higher. Pick the method with your accountant and do not switch casually; changing an inventory method for tax purposes generally needs IRS consent.

Using the calculator step by step

  1. Take beginning inventory from last period’s ending count, not from memory.
  2. Add purchases from supplier invoices dated in the period, net of returns and credits.
  3. Enter freight-in, the shipping you pay to bring goods to you. Delivery to customers is a selling cost and stays out.
  4. Add direct labor only if your accountant includes it; for a food producer, use production hours from time records times the wage.
  5. Enter the counted ending inventory and the revenue for the same dates, then compare the margin with last month.

Four ways the number drifts

What people ask about the cost of goods sold

Is direct labor part of COGS?

For manufacturers and food producers, labor that directly makes the product usually is. Service businesses and retailers often leave it out. Follow your accountant’s method and stay consistent.

What is the difference between COGS and cost of selling?

COGS covers producing or buying what you sold. Selling costs, such as commissions and advertising, are operating expenses below gross profit.

Why does my COGS swing month to month?

Usually inventory counts. A rushed or estimated count moves cost between months.

How do I lower COGS?

Review supplier prices, reduce waste and schedule production labor to demand.

Do service businesses have COGS?

Many report a cost of services instead, made up mainly of the labor and materials used on client work. If you do not hold inventory, the inventory lines in this calculator can be left at zero.

What is the difference between COGS and inventory turnover?

COGS is a dollar cost for the period. Turnover divides that cost by average inventory to show how many times stock was sold and replaced. This calculator shows both from the same inputs.

Related resources

More on this topic

Get direct labor right

EZTime records production hours by job and shift, so the labor in your COGS is real. Book a demo to see it.

General information and an estimate only. It is not accounting or tax advice. Inventory and COGS methods must follow your accountant’s guidance.