Calculate your exact Cost of Goods Sold for accurate profit and tax reporting.
📦
COGS Calculator
Enter your inventory and purchase figures
$
$
$
Cost of Goods Sold
$17,000.00
Beginning Inventory$10,000.00
+ Purchases$15,000.00
− Ending Inventory-$8,000.00
COGS = Beginning Inventory + Purchases − Ending Inventory. This is the standard formula used for both accounting and tax reporting purposes.
What Is COGS?
Cost of Goods Sold (COGS) is the direct cost of the products your business actually sold during a period. It's the figure you subtract from revenue to get gross profit, and it's reported on business tax returns by anyone who sells physical goods. Getting it right matters twice: once for knowing your real margins, and again for paying the right amount of tax.
Beginning inventory for this period should equal the ending inventory of the previous period.
In plain terms: everything you had at the start, plus everything you bought, minus what's still on the shelf, equals the cost of what you sold.
Worked Example
An online store starts the quarter with $10,000 of inventory at cost, buys $15,000 more during the quarter, and counts $8,000 left at the end.
Goods available for sale = $10,000 + $15,000 = $25,000
COGS = $25,000 − $8,000 = $17,000
If revenue for the quarter was $30,000, gross profit = $30,000 − $17,000 = $13,000
Gross margin = $13,000 ÷ $30,000 = 43.3%
Notice how sensitive the result is to the ending count. If the count had wrongly shown $9,000 left, COGS would drop to $16,000 and profit would look $1,000 higher than it really was.
What Counts as COGS (and What Doesn't)
Include costs directly tied to getting products ready to sell:
The purchase price of goods bought for resale, or the raw materials for products you make
Inbound freight and shipping to get inventory to you (sometimes called freight-in)
Direct labor for people who make or assemble the products
Production overhead tied to manufacturing, such as factory utilities or equipment used to make goods
Leave out general operating expenses: advertising, website and software costs, office rent, and administrative salaries. Outbound shipping to customers and marketplace or payment processing fees are usually recorded as selling expenses rather than COGS, though practice varies, so follow your accountant's approach and stay consistent. You can estimate those fees with our Amazon FBA, eBay, and Shopify calculators.
Inventory Valuation Methods
When prices change over time, the method you use to value inventory changes COGS:
FIFO (first in, first out) assumes the oldest stock sells first. When prices are rising, FIFO gives a lower COGS and a higher reported profit.
LIFO (last in, first out) assumes the newest stock sells first. When prices are rising, it gives a higher COGS and lower taxable profit. LIFO is permitted in the US but not under IFRS.
Weighted average cost spreads cost evenly across all units available, smoothing out price swings.
Whichever method you choose, apply it consistently from period to period. Switching methods generally requires approval or disclosure depending on where you file.
COGS and Taxes
In the US, sole proprietors report cost of goods sold in Part III of Schedule C, and partnerships and corporations typically use Form 1125-A. Other countries have their own rules. Understating COGS inflates profit and can lead to overpaying tax; overstating it understates profit and can create problems in an audit. Keep purchase invoices and a year-end inventory count to support the figure. This calculator is an estimating tool, not tax advice — confirm the final numbers with a qualified accountant.
Frequently Asked Questions
What is the formula for cost of goods sold?
COGS equals beginning inventory plus purchases during the period minus ending inventory. For example, $10,000 plus $15,000 minus $8,000 gives a COGS of $17,000.
Is shipping included in COGS?
Inbound shipping to get inventory to you is usually part of COGS. Shipping you pay to send orders to customers is usually treated as a selling expense instead. Follow your accountant's approach and apply it consistently.
Are marketplace fees part of COGS?
Usually not. Marketplace, referral, and payment processing fees are generally recorded as selling expenses. They still reduce your profit, so include them when you calculate your margin per sale.
Do service businesses have COGS?
Pure service businesses usually have no inventory, so they don't report COGS in the traditional sense. Some track a similar figure called cost of services or cost of revenue, covering direct labor and materials used to deliver the service.
What is the difference between FIFO and LIFO?
FIFO assumes the oldest inventory is sold first, while LIFO assumes the newest inventory is sold first. When costs are rising, FIFO produces lower COGS and higher profit, and LIFO produces higher COGS and lower profit.
Can COGS be negative?
No. A negative result means an input is wrong, most often an ending inventory figure that is too high or purchases that were left out. Recheck your inventory count and purchase records.