Start typing to discover tools…
Business Finance Calculator

Cost of Goods Sold Calculator

Calculate your cost of goods sold using beginning inventory, additional purchases, direct costs, and ending inventory. You can also include sales revenue to estimate gross profit and gross margin.

Enter Your Business Figures

All fields should cover the same accounting period.

$
Inventory value available at the start of the period.
$
Cost of inventory purchased during the period.
$
Freight, direct labor, packaging, or production costs.
$
Inventory value remaining at the end of the period.
$
Add revenue to calculate gross profit and gross profit margin.
Please enter valid values.

What Is Cost of Goods Sold?

Cost of goods sold, commonly called COGS, is the total direct cost of producing or purchasing the products a business sells during a specific accounting period. It helps businesses understand how much they spent to generate their sales.

COGS normally includes inventory purchases, raw materials, direct production labor, manufacturing supplies, packaging, and freight costs directly connected to obtaining or producing goods.

Measure Profitability

Subtract COGS from sales revenue to calculate your gross profit.

Manage Inventory

Compare beginning and ending inventory to understand product movement.

Improve Pricing

Use product costs and margins to create more sustainable selling prices.

How to Use the Cost of Goods Sold Calculator

Enter figures from the same month, quarter, or financial year. Mixing figures from different periods can produce an inaccurate result.

Select Your Currency

Choose the currency used in your accounting records. The selected currency only changes how the results are displayed.

Enter Beginning Inventory

Add the total value of inventory available at the beginning of the accounting period.

Add Purchases and Direct Costs

Enter inventory purchases and any additional costs directly related to obtaining or producing your goods.

Enter Ending Inventory

Add the value of unsold inventory remaining at the end of the accounting period.

Add Revenue and Calculate

Revenue is optional. Adding it allows the calculator to show gross profit, gross margin, and COGS as a percentage of sales.

Cost of Goods Sold Formula

The standard formula used to calculate cost of goods sold is:

COGS = Beginning Inventory + Purchases + Direct Costs − Ending Inventory

Direct costs can include freight, production labor, raw materials, and other expenses directly linked to goods sold.

COGS Calculation Example

Suppose a retailer starts the month with $20,000 in inventory, purchases $12,000 of additional products, pays $1,500 in direct freight costs, and has $8,000 of inventory remaining.

Calculation Item Amount
Beginning Inventory $20,000
Inventory Purchases $12,000
Additional Direct Costs $1,500
Ending Inventory − $8,000
Cost of Goods Sold $25,500

In this example, the business has a cost of goods sold of $25,500 for the month.

What Expenses Are Included in COGS?

The expenses included in COGS depend on the type of business. In general, only costs directly related to producing or acquiring goods for sale should be included.

Common Costs Included

Product purchase costs, raw materials, direct manufacturing labor, factory supplies, production-related packaging, inbound freight, and storage costs required during production may be included.

Costs Usually Excluded

Marketing, advertising, office rent, administrative salaries, website costs, accounting fees, and general business insurance are normally operating expenses rather than cost of goods sold.

Accounting treatment can vary by business type, location, and tax rules. Consult a qualified accountant when preparing official financial statements or tax returns.

Frequently Asked Questions

COGS equals beginning inventory plus inventory purchases and direct costs, minus ending inventory.

Direct labor used to manufacture a product may be included. Administrative, sales, and office salaries are generally excluded.

Subtract cost of goods sold from total sales revenue. For example, $50,000 in revenue minus $30,000 in COGS produces $20,000 in gross profit.

Some service businesses calculate cost of services instead. It may include direct labor, contractor costs, and materials used to deliver the service.

Ending inventory represents goods that were not sold during the period. It is subtracted because those goods should not be counted as a current-period expense.

A good margin varies by industry, product type, operating model, and competition. Compare your margin with similar businesses and your previous accounting periods.

No. All calculations are completed in your browser, and the information entered into the calculator is not submitted to a database by this page.