Cost of Goods Sold Calculator - COGS and Gross Profit

Calculate cost of goods sold from beginning inventory, purchases, and ending inventory, with optional gross profit from revenue.

Enter beginning inventory, purchases, and ending inventory to compute COGS. Add revenue to see gross profit for the same period.

Cost of Goods Sold Calculator - COGS and Gross Profit
COGS = beginning inventory + purchases − ending inventory

About the Cost of Goods Sold Calculator

Cost of goods sold, or COGS, is the inventory cost of units you actually sold in a period. It is the largest expense for many retailers and manufacturers and the starting point for gross profit. The cost of goods sold calculator uses the periodic inventory identity: beginning inventory plus purchases minus ending inventory. That identity does not require a perpetual inventory system. You need a count or a valued stock figure at the start, the goods bought (or manufactured) during the period, and a count at the end. Optional revenue turns the same worksheet into a gross-profit check: revenue minus COGS. COGS = beginning + purchases − ending. If you started with $20,000 of stock, bought $50,000, and finished with $15,000, COGS is $55,000. Goods available for sale were $70,000; $15,000 remains on the balance sheet. Gross profit is $35,000 on $90,000 of revenue, a 38.9% gross margin. Purchases should include freight-in and other costs to get inventory ready for sale if that is how you value stock. They should not include operating expenses such as advertising or office rent. Ending inventory at zero is allowed and means you sold through the entire available balance. Merchants use COGS to watch margin by month, to set reorder quantities, and to brief a lender. Manufacturers can treat “purchases” as the period’s manufacturing cost transferred to finished goods if that matches their records, though a full manufacturer worksheet also tracks WIP. Students use the identity to move between the inventory T-account and the income statement. Because the formula is periodic, shrinkage, theft, and obsolescence that reduce the ending count automatically raise COGS, which is economically honest if the count is real. Valuation method still matters even though it is not a separate input. FIFO, LIFO, and weighted average assign different dollars to ending inventory and therefore to COGS when prices change. The cost of goods sold calculator will not convert FIFO to LIFO; it only applies the three numbers you enter. Mixing a retail selling price into inventory fields will overstate COGS. Mixing sales tax collected into revenue will overstate gross profit. Returns of merchandise should reduce purchases or increase ending inventory according to your policy, not sit silently outside the three fields. Revenue is optional so you can compute COGS during a stocktake before the sales figure is closed. If revenue is blank, gross profit equals −COGS, which is a display artifact rather than a loss to report; enter revenue when you want a meaningful gross profit. Keep the period consistent: monthly beginning must match last month’s ending. After you calculate, compare COGS as a percent of revenue with the prior period and with your pricing plan. Use the cost of goods sold calculator as a control total against the inventory subledger, and let a bookkeeper apply tax rules, capitalization policies, and physical-count adjustments before the books close.

Cost of Goods Sold Examples

COGS is beginning inventory plus purchases minus ending inventory; gross profit uses optional revenue.

InputsResultHow to read it
Beginning $20,000, purchases $50,000, ending $15,000, revenue $90,000COGS $55,000.00Gross profit is $35,000.00 on that period’s sales.
Beginning $8,000, purchases $22,000, ending $5,000, revenue $40,000COGS $25,000.00Gross profit is $15,000.00 for a smaller shop with faster inventory turn.
Beginning $120,000, purchases $340,000, ending $90,000, revenue $500,000COGS $370,000.00Gross profit is $130,000.00; COGS is 74% of revenue on a high-volume mix.

How to Use the Cost of Goods Sold Calculator

  1. Enter beginning inventory at cost for the period, matching last period’s ending figure.
  2. Enter purchases or manufacturing cost added to inventory during the period.
  3. Enter ending inventory at cost; use zero if the stock was sold through.
  4. Optionally enter revenue, then select Calculate to see COGS and gross profit.

Cost of Goods Sold FAQ

What is the COGS formula?

Cost of goods sold equals beginning inventory plus purchases minus ending inventory. The identity values the goods that left inventory during the period at the cost figures you supply.

Does the cost of goods sold calculator use FIFO or LIFO?

Neither method is selected on the page. FIFO, LIFO, or weighted average already sits inside the beginning, purchases, and ending amounts you enter from your records.

Can ending inventory be zero?

Yes. A zero ending count means all goods available for sale were sold or written off, so COGS equals beginning inventory plus purchases. Blank ending inventory is also treated as zero.

How is gross profit calculated?

Gross profit is revenue minus COGS. If you omit revenue, the supporting line is not a meaningful profit figure, so add sales when you want margin as well as cost.

Should freight and labor go into purchases?

Include inbound freight and other costs you capitalize into inventory. Do not include downstream selling costs. Follow the same capitalization policy your accountant uses on the balance sheet.