Cost of sales explained: what it is and how to calculate it
Learn what cost of sales is, how to use the cost of sales formula, and how it shapes your pricing and profit.

Written by Lena Hanna—Trusted CPA Guidance on Accounting and Tax. Read Lena's full bio
Published Friday 20 November 2026
Table of contents
Key takeaways
- Include only direct costs in your cost of sales, such as materials, production labour, and shipping to customers, and leave out indirect costs like rent, marketing, and admin.
- Use cost of sales as your pricing baseline: charge above it, then add a profit margin that suits your industry, as margins vary widely between sectors.
- Reduce your cost of sales by negotiating supplier terms, comparing suppliers, improving production efficiency, and outsourcing selectively to turn fixed labour costs into variable ones.
- Track cost of sales monthly, or more often if your costs fluctuate, so you can spot rising costs early and adjust pricing or suppliers before margins shrink.
What is cost of sales?
Cost of sales is the total direct cost of producing or buying the goods and services a business sells during a period. The cost of sales formula is: opening inventory + purchases and other direct costs − closing inventory = cost of sales. Subtract it from sales to get gross profit.
For most small businesses, cost of sales equals direct costs. These are expenses directly linked to creating your product or delivering your service. Indirect costs, like rent or marketing, sit outside cost of sales.
What counts as cost of sales varies by business type:
- Retailers: Stock purchases, packaging, and shipping
- Service providers: Software subscriptions, subcontractor fees, and project materials
- Manufacturers: Raw materials, production labour, and equipment costs
Cost of sales formula
The cost of sales formula uses your stock figures and direct costs for a set period, such as a month or a financial year. Here's the formula in plain text:
Opening inventory + purchases and other direct costs − closing inventory = cost of sales
Each part of the formula covers a different slice of your costs:
- Opening inventory: The value of stock you hold at the start of the period
- Purchases: Stock and materials you buy during the period
- Other direct costs: Costs tied to each sale, such as production labour and inbound freight
- Closing inventory: The value of unsold stock left at the end of the period
Once you have your cost of sales, you can link it to your sales: sales − cost of sales = gross profit. If you sell services and hold no stock, your opening and closing inventory are zero, so cost of sales is simply your direct costs for the period.
For example, say your shop starts the month with R40,000 of stock, buys R100,000 more, and ends the month with R30,000 on the shelves. Your cost of sales is R40,000 + R100,000 − R30,000 = R110,000. If your sales for the month were R180,000, your gross profit is R70,000.
Cost of sales vs. cost of goods sold
Cost of sales and cost of goods sold (COGS) are similar, with one main difference: scope.
Cost of goods sold (COGS): COGS usually refers to the direct costs of producing or buying physical products, so product-based businesses often use it.
Cost of sales: Cost of sales is often used as the broader term, covering direct costs of delivering services as well as goods. The terms overlap, and usage varies between businesses.
For example, International Accounting Standard 2 (IAS 2) Inventories treats the cost of stock as its purchase cost, conversion costs, and any other costs of getting it to its current location and condition. When you sell that stock, its cost becomes an expense in your accounts.
When to use each term:
- Use COGS when calculating costs for physical products you manufacture or purchase for resale.
- Use cost of sales when your business delivers services or when you want to capture all direct costs, including distribution.
In practice, many businesses use these terms interchangeably. What matters is applying your chosen definition consistently.
Why is cost of sales important?
Cost of sales directly affects your profitability. It sets the baseline for your pricing. You need to charge above your cost of sales to make a profit.
Understanding your cost of sales helps you:
- set profitable prices: know your minimum price point before adding a margin. Margins vary widely by industry, as NYU Stern's industry margin data shows.
- spot margin pressure: identify rising costs like delivery fees before they erode profits.
- plan for growth: anticipate how costs change as your business scales.
Your cost of sales includes both fixed and variable costs:
- Fixed costs: Expenses that stay consistent regardless of sales volume, like employee salaries.
- Variable costs: Expenses that change with production levels, like shipping and raw materials.
Calculate your cost of sales regularly. Costs fluctuate, and tracking them helps you decide when to adjust prices or find new suppliers.
What to include in your cost of sales calculation
Knowing what to include in your cost of sales calculation prevents errors and gives you an accurate picture of your margins. The general rule: if a cost is directly tied to delivering your product or service, it counts.
Costs to include:
- Raw materials and components
- Direct labour (employees who make or deliver your product or service)
- Manufacturing or production costs
- Shipping and delivery to customers (many businesses treat freight for shipping to customers as part of cost of sales, while others classify it as a distribution cost, so apply your chosen approach consistently)
- Packaging materials
- Subcontractor fees for project delivery
- Software or tools essential to service delivery
Costs to exclude:
- Rent and utilities (unless a dedicated production facility)
- Marketing and advertising
- Administrative salaries
- Office supplies
- Insurance and legal fees
- General business software
When in doubt, ask: "Would I incur this cost if I didn't make this specific sale?" If the answer is yes, it's likely a business expense rather than cost of sales.
Cost of sales vs. expenses
Cost of sales covers costs directly tied to delivering your product or service. Business expenses are the broader costs of running your business, whether or not you make a sale.
To tell the difference:
- Cost of sales example: Delivery fees for an online store. Without delivery, products don't reach customers, so it's a direct cost of each sale.
- Business expense example: PR agency fees. This helps build your brand but isn't directly tied to delivering a specific product.
Track both numbers to make informed decisions. When sales drop, look at reducing business expenses. When profit margins shrink, focus on lowering your cost of sales.
How to calculate cost of sales in different industries
The cost of sales formula changes depending on your business type. Each formula captures the direct costs specific to how you deliver value to customers.
The standard formulas vary for service businesses, retailers, and manufacturers.
Cost of sales example formula for service businesses
Service businesses add up all costs directly tied to delivering client work. The formula typically includes labour, facilities, and project-related expenses.
Include in your calculation:
- Wages for employees who deliver services
- Workspace costs for service delivery
- Travel expenses for client projects
- Equipment used for client work
Exclude from your calculation:
- Back-office employee salaries
- General administrative costs
- Marketing and sales expenses
For freelancers working from home, travel and equipment costs may not apply.
Cost of sales example formula for retailers
Retailers calculate cost of sales using inventory values. The basic formula is opening inventory + purchases − closing inventory, but the valuation method matters.
For instance, US GAAP permits all four costing methods: first in, first out (FIFO), last in, first out (LIFO), weighted average, and specific identification. IAS 2, which South African businesses reporting under IFRS follow, doesn't permit LIFO.
Cost of sales example formula for manufacturing
Manufacturers include all costs from raw materials through to finished goods. The formula captures materials, production labour, and related expenses.
Typically included:
- Raw materials and components
- Direct production labour
- Manufacturing equipment costs
- Factory overhead directly tied to production
Decision point: Some manufacturers include warehousing and freight as cost of sales. Others treat these as operating expenses. Choose one approach and apply it consistently.
Cost of sales examples
Consistency matters more than the specific categorisation. Some costs fall into a grey area between cost of sales and operating expenses. The key is choosing an approach and sticking with it.
Common grey-area costs include:
- Sales commissions: Can be cost of sales (tied to each sale) or operating expense (general sales cost).
- Equipment repairs: Can be cost of sales (production equipment) or operating expense (general maintenance).
- Subcontractor fees: Can be cost of sales (project delivery) or operating expense (general support).
Retail business example
A homeware store owner calculates cost of sales for handmade pottery cups to set a profitable price.
The cost breakdown per cup includes the following:
- Purchase price from supplier: R50
- Shipping from supplier to store: R20
- Packaging for each cup: R30
Total cost of sales per cup: R100
To achieve a 50% markup (about a 33% gross margin), the store owner sets a retail price of R150 per cup. This leaves R50 gross profit after covering all direct costs.
How to reduce your cost of sales
Reducing your cost of sales improves profit margins without raising prices. Five strategies can help lower your direct costs.
- Negotiate with suppliers: Ask for volume discounts, better payment terms, or price matching. Even small reductions add up across all purchases.
- Compare supplier options: Shop around for raw materials and stock. New suppliers may offer better prices or quality for the same cost.
- Improve production efficiency: Invest in technology, equipment upgrades, or staff training to produce more with less waste and time.
- Optimise inventory management: Avoid overstocking and understocking, and choose a costing method that aligns with your financial goals. For example, IAS 2 allows FIFO and weighted average cost, so South African businesses reporting under IFRS choose between these methods.
- Outsource strategically: Contract specialists for specific tasks instead of hiring full-time staff. This converts fixed labour costs into variable costs you can scale with demand.
Track your costs with confidence using Xero
Costs change constantly, so a clear, current view of them helps you protect your margins.
Xero gives you a live view of your cost of sales and overall finances. Track income and expenses in real time, run reports to spot trends, and make informed pricing decisions.
With Xero, you can:
- monitor costs as they happen: see new transactions flow in through bank feeds, so your cost of sales stays up to date.
- run detailed reports: view profit and loss, cash flow projections, and custom financial statements.
- track project profitability: use job costing to see which work is most profitable.
Ready to take control of your costs? Get one month free and see how Xero simplifies your financial management.
FAQs on cost of sales
Answers to common questions about cost of sales and how it affects your business.
Is cost of sales an expense or income?
Cost of sales is an expense. It appears on your income statement (profit and loss) and reduces your gross profit.
What is sales and cost of sales?
Sales is the revenue you earn from selling goods or services, and cost of sales is the direct cost of producing or buying what you sold. If you earn R1,000,000 in sales with R900,000 in cost of sales, you're left with R100,000 gross profit.
What is an example of cost of sales?
For a bakery, flour, butter, packaging, and bakers' wages are cost of sales, while shop rent and social media ads are operating expenses. For a consultancy, subcontractor fees and travel for client projects count as cost of sales.
What is cost per sale?
Cost per sale is your total cost of sales divided by the number of units or sales in the period. For example, R110,000 cost of sales across 1,100 units sold works out at R100 per unit.
How often should I calculate my cost of sales?
Calculate cost of sales at least monthly, or weekly if your costs fluctuate or your margins are tight.
Can I use accounting software to track cost of sales?
Yes. Accounting software like Xero brings your direct costs and inventory records together, giving you an up-to-date view of your cost of sales and margins.
Disclaimer
Xero does not provide accounting, tax, business or legal advice. This guide has been provided for information purposes only. You should consult your own professional advisors for advice directly relating to your business or before taking action in relation to any of the content provided.
Start using Xero for free
Access Xero features for 30 days, then decide which plan best suits your business.