Cost of Goods Sold Calculator

Use this Cost of Goods Sold Calculator to work out the direct cost of the inventory you sold during a period. Enter your beginning inventory, purchases and ending inventory, and the calculator returns your COGS together with an optional gross profit when revenue is provided. It is built for retailers, ecommerce sellers, wholesalers and anyone who needs a clean COGS figure for pricing, tax or management reporting.

Enter inventory values at cost, not at retail price. Beginning inventory is the value on hand at the start of the period, purchases are the additional stock bought during the period, and ending inventory is the value remaining at the end. If you provide revenue, the calculator also returns gross profit and gross margin. The currency selector changes the display symbol only and does not convert between currencies.

Cost of Goods Sold
–
Cost of Goods Available for Sale
–
Gross Profit (optional)
–
Gross Margin (optional)
–
COGS as % of Revenue (optional)
–

Cost of goods sold is the direct cost of the inventory you sold during the period. It excludes operating expenses such as rent, marketing and salaries, which are deducted later to arrive at net profit. The calculator uses the basic COGS formula: beginning inventory plus purchases minus ending inventory. If your accounting system uses weighted average, FIFO or LIFO, the inventory values you enter should already reflect that method.

Popular Calculators

What Is a Cost of Goods Sold Calculator?

A Cost of Goods Sold Calculator is a tool that turns three inventory figures into the direct cost of the products you sold during a period. You enter the value of inventory at the start of the period, the value of additional purchases made during the period, and the value of inventory left at the end. The calculator applies the standard COGS formula — beginning inventory plus purchases minus ending inventory — and returns the cost of goods sold. That single number is the foundation of gross profit, pricing decisions and inventory planning.

The concept is sometimes shortened to COGS, and it appears on every income statement above the gross profit line. This COGS calculator does not replace your accounting system; it gives you a fast, transparent way to verify the COGS figure your system produces, or to estimate COGS for a new product line before your books are closed. For a retailer, wholesaler or ecommerce seller, understanding COGS is the difference between pricing that protects margin and pricing that quietly erodes it.

How the Cost of Goods Sold Calculator Works

The Cost of Goods Sold Calculator uses a single core formula:

COGS = Beginning Inventory + Purchases − Ending Inventory

Beginning inventory is the value of stock on hand at the start of the period, valued at cost. Purchases are the additional inventory bought during the period, also at cost. Ending inventory is the value of stock remaining at the end of the period. The difference between goods available for sale (beginning inventory plus purchases) and ending inventory is the cost of the goods that were actually sold.

The calculator also reports goods available for sale, which is a useful intermediate figure. If your goods available for sale is much larger than your COGS, you are carrying a lot of stock relative to sales, which ties up cash and may signal over-ordering. If goods available for sale is close to COGS, you are running lean, which is efficient but leaves less buffer against supply disruptions.

When you enter revenue, this COGS tool goes further and returns gross profit and gross margin. Gross profit is revenue minus COGS, and gross margin is gross profit divided by revenue, expressed as a percentage. These two figures tell you how much of each sales dollar remains after the direct cost of the product, which is the money available to cover operating expenses and profit.

Why the Cost of Goods Sold Calculator Matters for Pricing

COGS is the floor beneath every pricing decision. If you sell a product for 100 and your COGS is 75, you have 25 of gross profit to cover rent, marketing, salaries, payment fees and everything else. If your COGS is 95, you have 5, and almost any operating expense will push the product into a loss. The Cost of Goods Sold Calculator makes that gap visible before you commit to a price.

Pricing without a reliable COGS figure is guesswork. Many small businesses price by adding a standard markup to what they paid for the stock, without accounting for freight, duties, shrinkage or the cost of holding inventory. This COGS calculator forces you to use the full cost of the goods you sold, not just the invoice price from the supplier. That distinction is often the difference between a business that looks profitable on paper and one that actually is.

What Goes into Cost of Goods Sold?

This cost of goods sold tool is only as accurate as the values you enter. COGS includes the direct costs of acquiring or producing the goods you sold. For a retailer or wholesaler, that means the purchase price of the inventory plus freight-in, import duties and any other costs required to bring the goods to your shelf. For a manufacturer, COGS includes raw materials, direct labour and factory overhead directly tied to production.

What COGS should not include is operating expenses. Rent, marketing, salaried admin staff, insurance, software subscriptions and delivery to customers are operating expenses, not COGS. They are deducted after gross profit to arrive at net profit. Mixing operating expenses into COGS overstates the cost of the product and understates gross margin, which can lead to pricing that is too high or to a false sense that the business is less profitable than it is. The calculator assumes you have kept the two categories separate.

Shrinkage is another item worth handling deliberately. If inventory is lost to theft, damage or obsolescence, the ending inventory figure will be lower than expected, which mechanically increases COGS. Some businesses record shrinkage as a separate line rather than folding it into COGS. Either approach is defensible, but this COGS calculator will reflect whatever ending inventory value you enter, so decide on your policy and apply it consistently.

Inventory Valuation Methods and the Cost of Goods Sold Calculator

The Cost of Goods Sold Calculator uses the values you supply; it does not choose an inventory valuation method for you. In practice, the ending inventory figure depends on whether you use FIFO (first in, first out), LIFO (last in, first out) or weighted average cost. Each method produces a different ending inventory value when prices are changing, and therefore a different COGS.

Under FIFO, the oldest inventory is assumed to be sold first, so ending inventory reflects the most recent purchase prices. In a period of rising prices, FIFO produces a lower COGS and a higher gross profit. Under LIFO, the newest inventory is assumed to be sold first, so COGS reflects recent prices and is higher when prices are rising, which lowers reported profit. Weighted average cost smooths the effect by using an average cost per unit across the period.

This COGS tool does not need to know which method you used, but you should. If your accounting system values ending inventory under one method and you enter a figure derived under another, the COGS output will not match your books. For statutory reporting, use the same valuation method your accounts use, and document the choice so the calculation is auditable.

Worked Example Using the Cost of Goods Sold Calculator

A small retailer starts the quarter with 20,000 of inventory at cost. During the quarter, the retailer buys 50,000 of additional stock, including freight and duties. At the end of the quarter, a stock count values the remaining inventory at 15,000. Using the Cost of Goods Sold Calculator, goods available for sale is 20,000 + 50,000 = 70,000, and COGS is 70,000 − 15,000 = 55,000.

If the retailer also reports revenue of 80,000 for the quarter, the Cost of Goods Sold Calculator returns gross profit of 80,000 − 55,000 = 25,000 and a gross margin of 25,000 ÷ 80,000 = 31.25%. COGS as a percentage of revenue is 55,000 ÷ 80,000 = 68.75%. Those two percentages sum to 100%, which is a useful sanity check: gross margin and COGS percentage always add up to the whole.

Now suppose the retailer discovers that 2,000 of stock was damaged during the quarter and had not been written off. If ending inventory is corrected downward to 13,000, COGS rises to 57,000 and gross profit falls to 23,000. The calculator shows how sensitive gross profit is to the accuracy of the ending inventory count, which is why physical stock counts matter.

COGS vs Operating Expenses in the Cost of Goods Sold Calculator

The distinction between COGS and operating expenses is one of the most important in small business accounting, and the Cost of Goods Sold Calculator depends on getting it right. COGS is the direct cost of the goods sold. Operating expenses are the costs of running the business that are not directly tied to the goods. A simple test: if you sold no products this month, would the cost still exist? If yes, it is probably an operating expense. If no, it is probably COGS.

Freight-out is a good example. Shipping goods to a customer is an operating expense for most businesses, because it is a cost of selling, not a cost of the product itself. Freight-in, by contrast, is the cost of bringing stock to your premises, so it belongs in COGS. Payment processing fees are usually an operating expense, while packaging that becomes part of the product may be COGS. This COGS calculator does not enforce these classifications; you do, and the output is only as good as the inputs.

Common Mistakes When Using a Cost of Goods Sold Calculator

The first mistake is entering inventory at retail value instead of cost. That overstates both beginning and ending inventory and produces a COGS figure that has no relationship to your actual cost of goods. The second is forgetting to include freight-in and duties in purchases, which understates the cost of the goods you sold. The third is failing to write off damaged or obsolete stock before calculating ending inventory, which overstates ending inventory and understates COGS.

A fourth mistake is mixing periods. Beginning inventory should be the value at the start of the same period that purchases and ending inventory refer to. A fifth mistake is treating the Cost of Goods Sold Calculator output as the final word on profitability. COGS is only the first deduction on the income statement; operating expenses, interest and tax still come out below it. A healthy gross margin can still produce a net loss if operating expenses are too high.

Limitations of the Cost of Goods Sold Calculator

The Cost of Goods Sold Calculator assumes a periodic inventory system, where COGS is derived from beginning inventory, purchases and ending inventory at the end of the period. Businesses that use a perpetual inventory system track COGS continuously and may not need this calculation in the same form. The calculator also assumes that the inventory values you enter are accurate and consistently valued; it cannot detect miscounts or misclassifications.

The calculator does not model inventory holding costs, opportunity cost of capital tied up in stock, or the effect of purchase discounts that are recorded separately from inventory. It also does not adjust for returns, allowances or warranty costs, which may need to be handled separately depending on your accounting policy. Treat the output as a planning and verification tool, not as a substitute for a properly maintained inventory ledger.

Final Thoughts on the Cost of Goods Sold Calculator

COGS is one of the few accounting figures that every product business owner can calculate without an accounting degree, and the Cost of Goods Sold Calculator makes that calculation a two-minute exercise. Enter beginning inventory, purchases and ending inventory, and you have a defensible COGS figure plus an optional gross profit and gross margin. Use it to verify your books, to sanity-check a supplier price change, or to model the effect of a stock write-off before it hits your accounts.

This COGS calculator will not tell you whether your pricing is right, but it will tell you what each sale actually costs you in goods. That number is the starting point for every margin conversation, and it is the number this tool is built to surface.

Related Calculators

References

Frequently Asked Questions

What exactly does the Cost of Goods Sold Calculator measure?

It measures the direct cost of the inventory you sold during a period, using the formula beginning inventory plus purchases minus ending inventory. If you provide revenue, it also returns gross profit, gross margin and COGS as a percentage of revenue.

Should I enter inventory at cost or at retail price?

Enter inventory at cost. COGS is a cost figure, so both beginning and ending inventory must be valued at what you paid to acquire or produce the goods, not at the price you intend to sell them for. Using retail values will produce a meaningless COGS figure.

What is goods available for sale?

Goods available for sale is beginning inventory plus purchases. It represents the total value of stock you could have sold during the period. COGS is goods available for sale minus ending inventory — in other words, the value of the stock that actually left the business.

What happens if I type invalid text into the revenue field?

Because the revenue field is a number input, the browser may silently blank out invalid text. The calculator detects this via the browser’s validity state and shows an explicit error asking for a valid revenue amount or a blank field. That prevents the calculator from silently ignoring your revenue and returning a COGS figure without the gross profit context you expected.

Does the currency selector convert between currencies?

No. The selector changes the display symbol only — it does not apply exchange rates or convert values. Enter every monetary figure in the currency you have selected, and the outputs will use that same currency symbol throughout.

What is the difference between COGS and operating expenses?

COGS is the direct cost of the goods you sold. Operating expenses are the costs of running the business that are not directly tied to the goods, such as rent, marketing and salaries. COGS is deducted first to produce gross profit; operating expenses are deducted after that to produce net profit.

Can I use the Cost of Goods Sold Calculator for a service business?

The calculator is designed for product businesses with inventory. A pure service business usually has no inventory, so COGS in the traditional sense does not apply. If your service business holds parts or materials that are consumed in delivery, you can use the calculator by treating those items as inventory, but the concept is less central than it is for a retailer or manufacturer.

How often should I recalculate COGS?

At least once per reporting period, and more often if you manage inventory actively or if purchase prices are volatile. A COGS calculation built on stale inventory values will misstate both COGS and gross profit, which can lead to poor pricing and planning decisions.

Is the Cost of Goods Sold Calculator free to use?

Yes. This Cost of Goods Sold Calculator is completely free, requires no registration and works on any modern desktop or mobile browser. You can run as many scenarios as you like.

The Cost of Goods Sold Calculator turns three inventory figures into the direct cost of the goods you sold, plus optional gross profit and gross margin when revenue is provided. Enter inventory at cost, keep operating expenses separate, and use the output to verify your books, sanity-check your pricing and understand what each sale actually costs you in goods.