Use this calculator to find your results:
Enter beginning inventory value, purchases during the period, and ending inventory value.
The calculator shows how much you spent producing what you sold and calculates your gross profit margin.
AI Analysis
Click AI Analysis to see if your margins are sustainable. The system compares your data against revenue and benchmarks your gross profit margin.

It flags issues like production costs eating too much into sales or margins too thin to cover operating expenses. The analysis explains what your numbers mean for profitability and points out where to cut costs or adjust pricing.
What Exactly is Cost of Goods Sold? (And What It Isn’t)
It is the direct costs of producing the goods sold by a company.

This includes the cost of materials and the direct labor used to create the product.
It excludes indirect costs, such as distribution and sales force expenses.

Let’s use a simple example: a company that builds and sells wooden chairs.
- Included in Cost of Sales: The price of the wood, screws, paint, and the wages of the carpenter who assembles the chair.
- NOT included in Cost of Sales: The salary of the salesperson. The cost of online marketing. The rent for the corporate office. The expense of shipping the finished chair to a customer.
These other expenses are called Operating Expenses (OpEx) and are accounted for separately. The main distinction is that the cost of sales is directly tied to the creation of the product itself.

The Core Components
To get a more precise understanding, these direct costs are typically broken down into three categories:
- Direct Materials: These are the raw materials and parts that are physically part of the final product. For our chair maker, this is the wood, screws, and varnish. For a coffee shop, it’s the coffee beans, milk, and sugar.
- Direct Labor: This is the cost of wages for the employees who directly build or assemble the product. It’s the pay for the carpenter or the coffee roaster. This does not include salaries for management, marketing, or administrative staff.
- Manufacturing Overhead: These are the indirect product costs from the production facility. This can include rent for the workshop, utilities like electricity needed to run equipment, and the depreciation of that equipment over time.
What’s Included vs. Excluded
| Included | Excluded |
|---|---|
| Cost of raw materials | Sales & Marketing expenses |
| Cost of inventory for resale | Administrative salaries (CEO, HR, etc.) |
| Direct labor wages | Office rent & utilities |
| Factory rent & utilities | Customer service costs |
| Equipment depreciation | Shipping products to customers |
| Freight-in (shipping for materials) | Research & Development (R&D) |
Direct Costs for Different Business Types

- For Retail/Manufacturing Businesses: This is where the metric is most prominent. For a retailer, it’s the price they paid for the products they are now selling. For a manufacturer, it’s the full expense of producing the item, as detailed above.
- For Service-Based Businesses: Many pure service businesses, like a consultant or graphic designer, have a cost of sales near zero because they don’t sell a physical item. However, if a service business has direct costs to provide its service, those can be counted. For example, a mechanic’s cost of sales would include the parts used in a repair. A web developer’s direct costs might include stock photos or software licenses bought specifically for a client’s project.
Why You Absolutely Must Know Your Product Costs
It Reveals Your True Profitability
Your revenue only tells half the story. Subtracting your direct product costs from revenue gives you your Gross Profit. This figure shows how much money you make from sales before any other expenses are considered. A healthy gross profit is the foundation of a sustainable business.
It Guides Your Pricing Strategy
If your product’s price is too close to its production cost, your profit margins will be thin. Knowing your exact cost allows you to set prices that ensure profitability. If material costs rise, you’ll know precisely how much you need to adjust your prices to protect your margins.
It Improves Inventory Management
The cost of sales is deeply connected to your inventory. Tracking it helps you identify issues like waste, damage, or theft. A sudden spike in this metric without a matching increase in sales can be a red flag for an inventory problem.
It Is Required for Tax Reporting
Cost of sales is a direct business expense you deduct from your revenue on tax returns. An accurate figure reduces your gross profit and, therefore, your taxable income. Getting this number right is a legal requirement and can significantly affect how much tax you owe.
Direct Costs
For most businesses that hold inventory, the standard formula is straightforward:
Cost of Sales = Beginning Inventory + Purchases - Ending Inventory
Let’s break that down:
- Beginning Inventory: The value of all your inventory at the start of an accounting period. This should be the same as your ending inventory from the previous period.
- Purchases: The cost of any new inventory or raw materials you bought during the period.
- Ending Inventory: The value of all the inventory you have left at the end of the accounting period.
This formula works because it identifies the value of the inventory that is no longer in your possession—the inventory that was sold.
How to Value Your Inventory
The formula seems simple, but a complex question is hiding within it: what is the “value” of your inventory?

The cost of materials and products changes over time. The coffee beans you bought in January might cost less than those bought in March. Your chosen valuation method determines which cost you use when arriving at your cost of sales.
There are three common methods for this.
FIFO (First-In, First-Out)
This method assumes the first items you purchase are the first ones you sell. Think of a grocery store stocking milk. They push the oldest cartons to the front to sell them first. This is the most widely used method globally. During periods of rising prices, FIFO results in a lower cost of sales and a higher reported profit.
LIFO (Last-In, First-Out)
This method assumes the most recent items you purchased are the first ones you sold. Imagine a pile of sand. You take from the top (the last sand added) first. During periods of rising prices, LIFO results in a higher cost of sales and lower reported profit, which can lead to a lower tax liability. Note: LIFO is permitted under US GAAP but is forbidden by IFRS.
Weighted-Average Cost (WAC)
This method smooths out price fluctuations. It uses the average cost of all goods available for sale during the period. You find it with this formula:
Average Cost Per Unit = Total Cost of Inventory / Total Number of Units
You then multiply this average cost by the number of units sold to find your cost of sales.
Frequently Asked Questions (FAQ)

Is shipping/freight included in cost of sales?
It depends on which direction the shipment moves.
When you order raw materials or inventory and pay to get them delivered to your warehouse or store, that cost is called “freight-in.” This gets included in your cost of sales because it’s a direct expense of acquiring the goods you’re selling. You can’t sell those coffee beans without getting them shipped to your shop first.
When you ship finished products to customers, that’s called “freight-out.” This is treated as a selling expense and goes under operating expenses, not cost of sales. The reasoning is simple: the product is already made and sold at this point. The shipping is part of fulfilling the order, not creating the product.
Here’s a practical way to remember it: if the shipping happens before you can sell the item, it’s part of cost of sales. If it happens after the sale, it’s an operating expense.
Some businesses offer free shipping to customers. That shipping cost still counts as an operating expense, even though you absorbed it instead of passing it to the customer. You’re just choosing to cover that selling expense yourself to make the offer more attractive.
How do periodic and perpetual inventory systems affect the calculation?
The formula for cost of sales stays the same regardless of your system. What changes is when and how often you update your numbers.
With a periodic system, you physically count inventory at specific intervals—usually monthly, quarterly, or yearly. You only calculate cost of sales at the end of that period. Between counts, you don’t track individual sales or update inventory records. This method works well for small businesses with limited inventory or lower-value items. The downside is you won’t know your exact inventory levels or cost of sales until you do the count.
With a perpetual system, you update inventory records in real time with every single transaction. When you sell a product, the system immediately reduces inventory and records the cost of that item. When you receive new stock, it updates instantly. Modern point-of-sale systems and inventory software make this automatic. You always know your current inventory value and cost of sales at any moment.
The perpetual system gives you better visibility and control, but it requires technology and consistent data entry. The periodic system needs less daily maintenance but leaves you operating partially blind between counts.
Both systems arrive at the same cost of sales figure if your counts are accurate. The difference is how quickly you get that information and how much detail you have along the way.

What’s the difference between Cost of Sales and Operating Expenses (OpEx)?
Cost of sales covers what you spend to create or acquire the product itself. Operating expenses cover what you spend to run the business around that product.
Think of it this way: if you stopped making products tomorrow, would this expense disappear? If yes, it’s probably cost of sales. If you’d still have that expense even with zero production, it’s an operating expense.
Let’s use a furniture maker as an example.
The wood they buy is cost of sales. If they stop building furniture, they stop buying wood.
The carpenter’s wages while building a chair are cost of sales. No chairs being built means no hours paid for that work.
The factory rent is technically manufacturing overhead, which gets included in cost of sales, because they need that space specifically for production.
But the office rent where the sales team works? That’s an operating expense. They still need that office space even if the factory stops producing for a week.
The marketing budget to advertise furniture? Operating expense. Marketing continues whether you build 10 chairs or 100 chairs this month.
The CEO’s salary? Operating expense. The CEO gets paid regardless of production volume.
Here’s where it gets tricky: some expenses sit in a gray area. Electricity in a factory that powers production equipment is cost of sales. Electricity in the corporate office is an operating expense. The same utility bill splits between both categories depending on where and how you use it.
Another test: ask yourself if the expense changes proportionally with production volume. If you double production, do you double this expense? If yes, it’s likely cost of sales. If the expense stays relatively flat regardless of how many units you produce, it’s probably an operating expense.
This distinction matters because gross profit (revenue minus cost of sales) tells you if your core product is profitable before considering all the overhead of running a business. Operating expenses come out after that. You need both numbers to be healthy, but they measure different things.
— Zyflora AI (@BjjohaBjorn) October 27, 2025


