Get your first month of Zinance free.Get your first month free.Claim my free monthClaim
Unit economics

Cost of goods sold (COGS)

Also known as Cost of revenue, cost of sales

Cost of goods sold (COGS) is the direct cost of producing and delivering what you sell, raw materials, direct labor, payment processing, hosting for a software product.

Updated July 2026

Key takeaways

  1. COGS = Beginning Inventory + Purchases − Ending Inventory
  2. COGS defines your gross margin, which caps how much every sale contributes toward overhead and profit.

What is cost of goods sold (cogs)?

Cost of goods sold (COGS) is the direct cost of producing and delivering what you sell, raw materials, direct labor, payment processing, hosting for a software product. It sits right below revenue on the income statement and gets subtracted to reach gross profit. COGS scales with volume: sell more, and it rises with you.

Formula

Formula

COGS = Beginning Inventory + Purchases − Ending Inventory

  • Beginning Inventoryvalue of inventory on hand at the start of the period
  • Purchasescost of additional inventory or production added during the period
  • Ending Inventoryvalue of inventory still on hand at the end of the period

Worked example

A company starts the quarter with $50,000 of inventory, buys $120,000 more, and ends with $40,000, giving COGS of $130,000.

Why it matters for fast-growing companies

COGS defines your gross margin, which caps how much every sale contributes toward overhead and profit. Misclassifying costs, burying delivery in operating expenses, or the reverse, inflates or deflates margin and misleads pricing. For fast-growing companies, clean COGS is often the difference between scaling profitably and scaling your losses.

Frequently asked questions

What counts as COGS versus operating expenses?+
COGS is anything directly tied to producing or delivering the sale, materials, production labor, hosting, payment fees. Operating expenses are the costs of running the business regardless of any single sale, rent, admin salaries, marketing, general software. A rough test: if a cost rises step-for-step with units sold, it usually belongs in COGS.
Does a software company have COGS?+
Yes. Software COGS typically includes hosting and infrastructure, third-party API and data fees, payment processing, and support or onboarding staff tied to delivery. It's often labeled cost of revenue. These are the costs that separate revenue from gross profit and ultimately drive a SaaS company's gross margin.

Want these numbers tracked for you?

Zinance handles the books, the reporting, and the CFO-level read-outs for fast-growing companies, so your metrics stay current every day and investor-ready, without the back-office bloat.

Live in 7 business days No long-term contracts Your books belong to you