Optimized Sales Optimized Marketing Target Accounts For CROs For CFOs For CMOs Blog News Glossary Compare Tools About Schedule a Demo
Free Tool

Cost of Sales Calculator

ORM Technologies
Home/ Tools/ Cost of Sales Calculator

Cost of sales is the direct cost of what you sold in a period: beginning inventory plus purchases and direct costs, minus ending inventory. Divide it by revenue for cost of sales as a percent of revenue. In B2B SaaS the same words mean the cost of selling, so this calculator keeps the accounting and sales views on separate tabs.

Accounting view, for a business that buys or makes goods. Use one period (a year, a quarter or a month) for every box.

Inventory and direct costs
Last period's ending inventory
Goods and materials bought, net of returns and discounts
People who make the product, not office or sales staff
Freight in, factory overhead, packaging
Counted or valued at period end
Sales after returns and discounts
Cost of sales
$550,000
61.1% of revenue
$350,000
Gross profit
38.9%
Gross margin
63.6%
Markup on cost
4.1 (90 days)
Inventory turns (days on hand)
Cost of sales buildAmount
Beginning inventory$120,000
+ Purchases$480,000
+ Direct labor$60,000
+ Other direct costs$40,000
= Goods available for sale$700,000
- Ending inventory($150,000)
= Cost of sales$550,000

Cost of sales is $550,000: you had $700,000 of goods available and $150,000 is still in stock. That is 61.1% of revenue, which leaves $350,000 of gross profit, a 38.9% gross margin (a 63.6% markup on cost).

The Forecast Brief

Get The Forecast Brief

You just worked out your cost of sales. The Forecast Brief is a short email from Pete Furseth, ORM's COO, built on what ORM sees in its customers' forecasts.

Cost of sales formulas, with Excel and Google Sheets versions

Every number the calculator shows comes from one of these. Examples use the calculator's default numbers, which are illustrative. The cell formulas work the same in Excel and Google Sheets.

MeasureFormulaExcel or SheetsExample (illustrative)
Cost of sales (goods)Beginning inventory + purchases + direct labor + other direct costs - ending inventory=B2+C2+D2+E2-F2$700,000 - $150,000 = $550,000
Cost of sales as % of revenueCost of sales / revenue x 100=G2/H2$550,000 / $900,000 = 61.1%
Gross profitRevenue - cost of sales=H2-G2$900,000 - $550,000 = $350,000
Gross marginGross profit / revenue=(H2-G2)/H2$350,000 / $900,000 = 38.9%
Markup on costGross profit / cost of sales=(H2-G2)/G2$350,000 / $550,000 = 63.6%
Cost from price and marginPrice x (1 - gross margin)=B2*(1-C2)$100 x (1 - 40%) = $60
Inventory turnsCost of sales / average inventory=G2/((B2+F2)/2)$550,000 / $135,000 = 4.1
SaaS cost of revenue %Delivery costs / total revenue=SUM(D3:H3)/(B3+C3)$8,800,000 / $40,000,000 = 22.0%
Cost of selling per $1 bookedFully loaded sales cost / (new + expansion ARR)=SUM(B4:H4)/(J4+K4)$6,000,000 / $10,000,000 = $0.60
Sales and marketing % of revenue(Sales cost + marketing) / total revenue=(SUM(B4:H4)+I4)/L4$9,000,000 / $40,000,000 = 22.5%

Column A holds a label. Row 2 holds the goods tab: B2 beginning inventory, C2 purchases, D2 direct labor, E2 other direct costs, F2 ending inventory, G2 cost of sales and H2 revenue. Row 3 holds the SaaS tab and row 4 the selling tab, each starting in column B in the calculator's box order. Format percentage cells as %, and wrap each division in IFERROR, as in =IFERROR(G2/H2,""), so a blank revenue cell shows nothing in place of #DIV/0!.

How to calculate cost of sales, step by step

Start from inventory, add what you spent to buy or make goods, and subtract what is left. The layout is the same one the IRS uses on Form 1125-A, Cost of Goods Sold.

  1. Take beginning inventory. It is last period's ending inventory, unchanged. If the two numbers do not match, fix that first.
  2. Add purchases. Goods and materials bought for resale or production, net of returns and supplier discounts.
  3. Add direct labor. Wages of the people who make the product. Leave out office, sales and marketing staff.
  4. Add other direct costs. Freight in, packaging, and production overhead such as factory rent and utilities. The total is goods available for sale.
  5. Subtract ending inventory. Count it or value it at the end of the period, using the same costing method as last time.
  6. Divide by revenue. Cost of sales over net revenue, times 100, is cost of sales as a percent of revenue. One hundred percent minus that number is your gross margin.

A service business or a SaaS company usually holds no inventory, so steps 1 and 5 drop out. Cost of sales is simply the period's delivery cost: the people and systems that delivered what customers paid for.

Which cost of sales are you calculating?

Three different numbers travel under the same name. Each tab of the calculator runs one of them. The line between the first two and the third is drawn in cost of sales vs cost of goods sold.

Goods (accounting)SaaS cost of revenue (accounting)SaaS cost of selling (operator)
What goes inInventory used, purchases, direct labor, freight in, production overheadHosting, support, embedded third-party software, product operations, services deliveryRep pay and commission, benefits, sales managers, SEs and SDRs, enablement, sales tools, travel
What stays outHead office rent, marketing, sales pay, interestSales, marketing, R&D, general and administrativeHosting and support (COGS), marketing unless you want the combined view
Divided byNet revenueTotal revenue, or each revenue line for its own marginNew and expansion ARR booked, or total revenue for the P&L view
Where it sitsAbove gross marginAbove gross marginBelow gross margin, in operating expense
Who reads itController, owner, lender, tax filerCFO, investorsCRO, CFO, RevOps
Linked metricGross margin, markup, inventory turnsGross marginCAC, CAC ratio, sales efficiency

Once you have the percentage, the question is what it means and what to compare it with. That reading, with both meanings of the ratio side by side, is on the cost of sales ratio page.

Worked example: one product company, one software company

Both use the calculator's default numbers. They are illustrative.

The product company. It starts the year with $120,000 of inventory, buys $480,000 of goods, pays $60,000 of direct labor and $40,000 of freight and production overhead. That is $700,000 of goods available for sale. It ends the year with $150,000 in stock, so cost of sales is $700,000 - $150,000 = $550,000. On $900,000 of revenue, cost of sales is 61.1%, gross profit is $350,000 and gross margin is 38.9%. Average inventory is $135,000, so stock turned about 4.1 times, roughly 90 days on hand.

The software company. It recognizes $36,000,000 of subscription revenue and $4,000,000 of services. Delivering the subscription cost $6,200,000 ($3,000,000 hosting, $2,200,000 support, $600,000 embedded software, $400,000 product operations). Delivering services cost $2,600,000. Cost of revenue is $8,800,000, or 22.0% of $40,000,000, for a 78.0% gross margin. The split tells the real story: subscription runs at 82.8% and services at 35.0%.

The same software company also spent $6,000,000 to sell: $2,600,000 of rep base pay, $900,000 of commission, $500,000 of benefits and taxes, $800,000 of management, $600,000 of SEs and SDRs, $400,000 of enablement and tools and $200,000 of travel. It booked $6,000,000 of new customer ARR and $4,000,000 of expansion. Its cost of selling is $0.60 per dollar booked, or 15.0% of total revenue. Add $3,000,000 of marketing and sales and marketing is 22.5% of revenue. One company, three cost of sales numbers: 22.0%, 60% and 15.0%. Say which one you mean.

Cost of sales benchmarks, with sources

Cost of sales as a percent of revenue is 100% minus gross margin, so gross margin data gives the benchmark directly. The industry rows are averages for US-listed companies from Aswath Damodaran's dataset at NYU Stern, updated January 2026. The SaaS rows are survey medians.

GroupGross marginImplied cost of salesSource
Software (system and application)71.7%28.3%Damodaran, Jan 2026
Apparel56.9%43.1%Damodaran, Jan 2026
Machinery37.5%62.5%Damodaran, Jan 2026
Retail (general)33.2%66.8%Damodaran, Jan 2026
Restaurants and dining32.2%67.8%Damodaran, Jan 2026
Retail (grocery and food)26.3%73.7%Damodaran, Jan 2026
Auto and truck10.4%89.6%Damodaran, Jan 2026
Total market (5,994 firms)37.8%62.2%Damodaran, Jan 2026
SaaS, total revenue (median)77%23%Benchmarkit, 2025
SaaS, subscription revenue (median)81%19%Benchmarkit, 2025
SaaS, professional services (median)30%70%Benchmarkit, 2025

For the cost of selling there is no gross margin to subtract, so the yardsticks are spend ratios. Benchmarkit's 2025 survey puts median sales and marketing spend at 37% of revenue: 47% for VC-backed and 33% for PE-backed companies. Its median New CAC Ratio is $2.00 of sales and marketing expense per $1.00 of new customer ARR, the bottom quartile spends $2.82, and the median Expansion CAC Ratio is $1.00. The calculator's selling tab uses those two medians to price your bookings mix. A sales-only number sits below all of these, because marketing is out. For what makes a SaaS gross margin good, read what is a good gross margin for SaaS.

Common cost of sales mistakes

  • Restating beginning inventory. It must equal last period's ending inventory. If it does not, cost of sales for one of the two periods is wrong.
  • Leaving out freight in. Shipping goods to you is part of their cost. Shipping goods out to customers is often booked as a selling expense instead. Pick one treatment and keep it.
  • Counting sales pay as cost of goods sold. Commission and rep salaries are a cost of winning the customer, not of delivering the product. They belong on the selling tab.
  • Hiding support or services delivery in operating expense. It flatters gross margin and makes sales efficiency look worse at the same time. The checklist is in what to include in SaaS COGS.
  • Mixing periods. A year of cost over a quarter of revenue quadruples the ratio. Use the same span on both sides.
  • Mixing commission bases. Your P&L may show commission amortized over the contract, while your plan uses commission paid. Either works. Switching between them quarter to quarter does not.
  • Dividing selling cost by pipeline. Pipeline is not bookings. Across ORM customers, only about 20% of the pipeline dated to close in a quarter on its first day closes in that quarter.

What moves the cost of selling, according to Pete Furseth

The goods number moves with prices and inventory. The selling number moves with how the sales team is planned. Pete Furseth, ORM's COO, sees the same patterns across ORM customers.

  • New hires cost money before they sell. A new rep adds full cost on day one. In ORM customer data it can take a seller 15 to 18 months to confidently hit quota, so a hiring class pushes the ratio up for a year or more.
  • Assigned quota is not productive quota. A rep with a $1 million quota at a tenure level that measures 70% productive should count as about $700,000 of capacity. Plan cost against productive quota, or the ratio surprises you.
  • Planning is where the savings are. ORM frames capacity as math: hit the bookings target at the lowest sales cost, or get the most bookings from a fixed budget. Done well, Pete says that cuts sales cost by roughly 10 to 15% for the same target, or adds 10 to 15% more productive capacity for the same spend. Moving from a one-year to a two-year capacity plan alone can cut cost by about 5%. Model your own headcount in the sales capacity planner.
  • Deal size moves the bottom line. When a new competitor enters and creates pricing pressure, average deal size falls. Sales cost per deal holds, so the ratio climbs with no change in rep behavior.
  • Pull-ins cost twice. Deals pulled forward to save a quarter usually carry a discount, and they shrink next quarter's starting pipeline. Pipeline for a quarter is often built 6 to 12 months ahead, so you then spend more to refill it.

For the cost per rep that feeds the first box group, see fully loaded cost per rep. For the same spend counted per customer, run the CAC calculator.

ORM's take: the ratio tells you the cost, not the cause

This calculator gives you a clean cost of sales number for one period, in whichever view you need. It cannot tell you why the selling number moved: whether deal size fell, win rates dropped, cycles stretched or a hiring class has not ramped yet.

That is what ORM's models do. ORM builds ramp curves by role and region from your own data, plans hires so capacity is ready before the revenue is due, and forecasts bookings against that plan. ORM targets 95% forecast accuracy. The cost of sales ratio shows what you spent. The plan and the forecast show what the spend will produce.

Common questions

How do you calculate cost of sales?

Add beginning inventory, purchases, direct labor and other direct production costs, then subtract ending inventory. The result is the cost of what you actually sold. A business that starts with $120,000 of stock, buys $480,000, spends $100,000 on labor and freight, and ends with $150,000 on the shelf has a cost of sales of $550,000. Divide by revenue for the percentage.

Does cost of sales include salaries?

Only the salaries of people who make or deliver what you sold. Production workers, support agents and implementation consultants count. Office staff, marketers and sellers do not, in the accounting view. The SaaS operator view is different: there, cost of sales means the cost of selling, so rep salaries and commission are the biggest line. Name the version before you compare numbers.

What is a good COGS to sales ratio?

It depends on the industry, because gross margin does. Across US-listed companies in Damodaran's January 2026 data, the average gross margin is 37.8%, so cost of sales runs about 62% of revenue. System and application software sits near 28%, general retail near 67% and grocery near 74%. Compare yourself with your own industry and your own trend, not one number.

How do you work out cost price from selling price?

Multiply the selling price by one minus the gross margin. A $100 item sold at a 40% margin cost $60. If you know the markup instead, divide the price by one plus the markup: a $100 item with a 66.7% markup also cost $60. Margin is measured on the price and markup on the cost, which is why the two percentages differ.

How do you calculate cost of sales for a SaaS or service company?

Add up what it cost to deliver the service in the period: hosting and infrastructure, customer support, third-party software built into the product, the operations staff who keep it running, and the people who deliver onboarding and services. There is usually no inventory, so nothing is subtracted. Divide by revenue. Benchmarkit's 2025 median gross margin is 77%, which puts cost of revenue near 23%.

What is the difference between margin and markup?

Both compare gross profit with something else. Margin divides gross profit by revenue. Markup divides it by cost. An item that costs $60 and sells for $100 has $40 of gross profit, a 40% margin and a 66.7% markup. Margin can never reach 100%, while markup has no ceiling. Pricing teams often quote markup and finance teams report margin, so check which one you have.

See what your sales spend will produce

This tool shows what you spent to sell. ORM plans capacity and forecasts the bookings that spend should deliver.

Schedule a Demo

More free tools