CalcWorldHub
Money & finance · CalcWorldHub

Cost of Goods Sold from Inventory and Purchases

A cost of goods sold calculator organizes beginning inventory, purchases, other direct costs, and ending inventory to estimate the cost associated with goods sold. It can help a small business review a period before comparing sales and gross profit. Enter dollar amounts from a consistent accounting period. The result is a simplified calculation, not a tax filing determination. Use the cost of goods sold calculator after checking what belongs in each field.

Open calculator
Beginning stock, purchases, ending stock and sales feed a simplified COGS and margin summary.

Share this article

Inventory at the start and end of a period brackets purchases and direct costs.
Cost-of-goods-sold inputs.

Keep inventory amounts on the same basis

Beginning inventory is the cost of goods available at the start of the period, while ending inventory is the cost still on hand at the end. Purchases and other direct costs must relate to the goods counted in that period. IRS Publication 334 explains inventory and cost-of-goods-sold rules for U.S. small businesses, but tax treatment depends on business facts and applicable accounting methods.

Use the calculator’s cost equation

The calculator uses COGS = beginning inventory + purchases + other direct costs − ending inventory. A positive ending inventory is subtracted because those goods have not been treated as sold under this simplified formula. The meaning of “other direct costs” must be defined consistently; do not enter general overhead or expenses that belong elsewhere just because they are paid in the same month.

Connect COGS to gross profit

Gross profit is net sales minus the calculated COGS. Gross margin is gross profit divided by net sales, multiplied by 100. The page displays this percentage to at most one decimal place, omitting a trailing .0. These measures describe a sales period before many operating expenses, interest, taxes, and other items. The calculator assumes the sales figure and cost inputs use a compatible period and currency.

Reconcile purchases and inventory changes

Compare beginning inventory with the previous period’s ending inventory and investigate differences before accepting a result. Returns, freight-in, owner withdrawals, damaged stock, production costs, and inventory valuation can affect the amount used in formal accounts. The page does not model each adjustment separately; it accepts one purchases number and one other-direct-cost number.

Interpret a margin carefully

A gross margin of 34% means the calculated gross profit is 34 cents per dollar of net sales under these inputs. It is not net profit and does not say whether a business is financially healthy. Product mix, returns, discounts, accounting methods, and inventory valuation can change the ratio. Compare periods with the same rules and avoid comparing businesses that classify costs differently.

Use the estimate as a review worksheet

Retain the inventory count date, valuation method, purchase records, direct-cost detail, sales basis, and currency with the result. IRS guidance describes U.S. tax treatment for inventory-bearing businesses; this article’s equation is a planning aid and does not replace local tax or accounting advice. For official books or a return, follow the governing standards and consult a qualified professional.

Worked examples

Both examples use one consistent period and compute cost of goods sold, gross profit, and gross margin.

A shop with a 34.0% gross margin

Inputs: Beginning inventory = $12,000; purchases = $30,000; direct costs = $1,800; ending inventory = $9,500; net sales = $52,000.

Calculation: COGS = 12,000+30,000+1,800−9,500 = $34,300; gross profit = 52,000−34,300 = $17,700; margin = 17,700/52,000×100 ≈ 34.0385%.

The full calculation is about 34.0385%, while the page displays 34% after rounding to one decimal and trimming the trailing zero. Operating expenses and taxes are not deducted.

A second period with lower sales

Inputs: Beginning inventory = $8,500; purchases = $18,400; direct costs = $1,250; ending inventory = $7,900; net sales = $34,500.

Calculation: COGS = 8,500+18,400+1,250−7,900 = $20,250; gross profit = 34,500−20,250 = $14,250; margin = 14,250/34,500×100 ≈ 41.3043%.

The full calculation is about 41.3043%, which the page displays as 41.3%. This does not imply higher net profit because operating expenses and period-specific adjustments remain outside the calculation.

The inventory equation and gross-margin ratio are distinct outputs.
COGS and gross margin.

Reconcile records before comparing periods

A count and valuation at each period boundary are central to the inventory calculation. Reconcile purchase returns, freight-in, goods withdrawn for personal use, and damaged items according to the accounting method that applies to the business. The single purchases input cannot represent those adjustments separately. IRS guidance is specific to U.S. tax reporting; another jurisdiction or accounting framework may classify inventory costs differently.

Sources and further reading

Share this article

Browse all articles · Calculator: Cost of goods sold calculator