Rankite
ServicesResultsToolsTeamAboutBlogCareersContactFree SEO Audit
Free tool

COGS Calculator: Beginning Inventory Plus Purchases Minus Ending Inventory

Enter beginning inventory, purchases and ending inventory, plus revenue if you want gross profit too, free.

Home / Tools / COGS Calculator
Cost of goods sold
-
Gross profit / gross margin
-

COGS is beginning inventory plus purchases, minus ending inventory.

Built by Rankite, the SEO team behind Swordfish AI's +400% revenue and Zluri's +45% organic growth. See the case studies

How to calculate cost of goods sold

Add beginning inventory to purchases made during the period, then subtract ending inventory. A business that starts a quarter with $50,000 in inventory, buys $200,000 more in stock, and ends the quarter with $40,000 in inventory has a COGS of $50,000 plus $200,000, minus $40,000, which is $210,000. The logic is straightforward: whatever inventory value did not end the period sitting on the shelf must have been sold.

COGS feeds directly into gross profit and gross margin, since gross profit is simply revenue minus COGS. Tracking COGS accurately each period is what makes those two downstream numbers meaningful rather than guesswork.

What to include, and leave out, of COGS

COGS should include the direct costs of producing or acquiring what was actually sold: the wholesale or manufacturing cost of the goods, direct labor tied to production, and freight-in costs to get inventory into your warehouse. For a retailer or ecommerce seller, that usually means the cost paid to a supplier or manufacturer plus any inbound shipping.

Indirect costs like marketing, sales commissions, warehouse rent, and outbound shipping to customers are generally kept out of COGS and tracked separately as operating expenses. Mixing the two together understates gross margin and makes it harder to see whether pricing and product costs are actually healthy on their own.

Related articles

FAQ

COGS Calculator: questions, answered

What is cost of goods sold?
Cost of goods sold (COGS) is the direct cost of the inventory a business actually sold during a period. It is calculated as beginning inventory, plus purchases made during the period, minus ending inventory still on hand.
What is included in COGS?
COGS typically includes the wholesale or manufacturing cost of the goods sold, direct labor involved in producing them, and freight-in costs to bring inventory into the warehouse. It covers the direct cost of the product itself, not the cost of marketing or selling it.
How does COGS affect gross profit?
Gross profit is revenue minus COGS, so a higher COGS directly reduces gross profit and gross margin for the same amount of revenue. Tracking COGS accurately each period is what makes gross profit and gross margin meaningful, rather than rough estimates.
Does COGS include shipping and marketing costs?
Inbound freight, the cost to ship inventory into your warehouse from a supplier, is usually included in COGS. Outbound shipping to customers, along with marketing, advertising and sales commissions, is generally excluded from COGS and tracked separately as an operating expense instead.

More free tools

Let's grow

Ready to own page one?

Get a free, no-obligation SEO audit and a 30-minute strategy session. We'll show you exactly where the growth is hiding.

Book your free audit Explore services
Get in touch

Tell us about your project

Fill out the form and we'll get back to you within one business day. Prefer email? Write to us directly at contact@rankite.com.

Or copy our email and write to us directly: contact@rankite.com