Cost of sales formula: how to calculate it step by step
Learn the cost of sales formula and how to calculate direct costs for your small business.

Written by Lena Hanna—Trusted CPA Guidance on Accounting and Tax. Read Lena's full bio
Published Friday 17 April 2026
Table of contents
Key takeaways
- Calculate your cost of sales using the formula: beginning inventory + purchases − ending inventory, making sure to include all direct costs such as raw materials, labour, and shipping, but leaving out indirect costs like rent and marketing.
- Use your cost of sales as your pricing baseline, setting your selling price above this figure to ensure every sale generates a profit rather than a loss.
- Track your cost of sales every month so you can spot rising expenses early and adjust your prices or switch to cheaper suppliers before your profit margin shrinks.
- Apply the same rules every time you categorise grey-area costs, such as sales commissions or equipment maintenance, so your data stays consistent and reliable for pricing and profit decisions.
What is cost of sales?
Cost of sales is the total amount you spend to deliver your products or services directly to customers. You might also see it called cost of goods sold (COGS), as both terms measure the same thing: your direct costs of doing business.
This includes all expenses tied to creating what you sell, from materials and labour to shipping and packaging.
Why it matters: Understanding your true cost of sales helps you set profitable prices and make smart sourcing decisions. This is particularly vital given that the gross profit rate is the most commonly used business ratio in HMRC.
Direct costs only: Cost of sales includes only direct costs, expenses you can trace directly to specific products or services. It doesn't include indirect costs like rent, marketing or general administration.
Examples by business type:
- Retailers: product purchases, packaging materials and shipping fees
- Service businesses: software subscriptions, contractor fees and travel expenses
- Manufacturers: raw materials, production labour and equipment maintenance
Cost of sales vs COGS vs operating expenses
It's easy to confuse cost of sales, cost of goods sold (COGS), and operating expenses. Knowing the difference helps you categorise your spending correctly.
- Cost of sales: The direct costs of producing goods or delivering services. This term is often used by both service and retail businesses.
- Cost of goods sold (COGS): The direct costs of producing physical products. It's usually used interchangeably with cost of sales for inventory-based businesses.
- Operating expenses: The day-to-day costs of running your business that aren't tied to a specific product or service. This includes rent, marketing, and administrative salaries.
Why is cost of sales important?
Cost of sales is your profit baseline. You need to charge more than this amount to make a profit. Knowing these costs helps you set prices that keep your business profitable.
Common cost calculation mistakes:
- Overlooking hidden expenses: storage fees, equipment costs or workspace charges.
- Underestimating growth costs: additional space, staff or inventory requirements.
- Ignoring price changes: fluctuations in shipping, materials or supplier rates, a critical area to monitor as new reporting rules for supplier finance arrangements take effect in 2025.
Types of costs to include:
- Fixed costs: employee salaries and equipment leases
- Variable costs: materials, shipping and transaction fees
How often to calculate: Track your cost of sales every month. This helps you spot rising expenses early, so you can adjust prices or find cheaper suppliers. Bear in mind that even small accounting omissions can cause a noticeable difference in the rate of gross profit.
Cost of sales formula
The cost of sales formula calculates the direct cost of inventory sold in a period: beginning inventory + purchases − ending inventory = cost of sales.
If you sell physical products, use this cost of sales formula to work out your direct costs. The result shows how profitable your business is.
How to calculate cost of sales step by step
Calculating your cost of sales is straightforward when you break it down into steps. Follow this process to find your direct costs for a specific period.
- Determine your beginning inventory value at the start of the period.
- Add the cost of any new inventory purchases made during that time.
- Include any other directly attributable costs, such as freight-in charges.
- Count your ending inventory value at the close of the period.
- Subtract the ending inventory from your total beginning inventory and purchases to get your final cost of sales.
What to include in your cost of sales
Include all direct costs of producing or buying what you sell. Common costs include:
- Raw materials: finished products or components purchased for resale
- Direct labour: wages for production or service delivery staff
- Shipping: freight-in charges for acquiring inventory
- Packaging: materials used to prepare products for sale
- Essential tools: software subscriptions required for delivering a service
How to calculate cost of sales in different industries
Industry-specific calculations give you more accurate costs. The main idea stays the same, but each business type focuses on different cost categories. Use the formula that fits your business.
Cost of sales example formula for service businesses
Service businesses focus on costs directly tied to delivering client work.
Include in your calculation:
- Direct labour: employees working on client projects
- Service delivery: software, tools and travel expenses
- Workspace: office space used for client work
Exclude from your calculation:
- Back-office staff: admin, marketing and management roles
- General expenses: costs not tied to specific services
Cost of sales example formula for retailers
Retailers can use this cost of sales formula for inventory accounting.
Ecommerce businesses might add shipping and transaction fees, which are common costs for every online sale.
Cost of sales example formula for manufacturing
Manufacturers have raw materials and production costs to consider in their cost of sales calculations.
Some manufacturers choose not to include warehousing or freight if they classify these as operating expenses rather than direct costs.
Cost of sales examples
Consistency matters more than perfection when you categorise costs. Apply the same rules every time you calculate.
Common grey-area costs:
- Sales commissions: classify as cost of sales or operating expense
- Equipment maintenance: classify as cost of sales (if production-related) or operating expense
- Quality control: classify as cost of sales if directly tied to products
Once you decide how to categorise a cost, use the same approach every time. This gives you reliable data for pricing and profit decisions.
Retail business example
A homeware store owner calculates the cost of sales for handmade pottery cups to set a profitable price.
Step-by-step calculation:
- Product cost: £5 per cup from the supplier
- Shipping cost: £2 per cup for delivery to store
- Labour cost: £3 per cup for shelving and customer service
- Total cost of sales: £10 per cup
Pricing decision: With a £10 cost of sales, the owner sets a retail price of £15 per cup. This creates a 50% markup on cost (£5 profit ÷ £10 cost = 50%).
Simplify your cost tracking with Xero
Business costs change often. Track them simply to stay in control.
With Xero Projects, you see your income and costs in real time, so you always know your financial position. Use analytics and reporting features to view cash flow projections, income and expenditure reports, and other financial statements.
Ready to simplify your cost tracking? Get one month free and see how Xero keeps you in control of your numbers.
FAQs on cost of sales
Common questions about calculating your cost of sales.
What is the formula for COGS?
The COGS formula is: beginning inventory + purchases − ending inventory = cost of sales.
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.