How to Calculate the Cost of Goods Sold

If you own an inventory-based business, calculating your cost of goods sold (COGS)—also known as the cost of sales—is a crucial part of understanding your profit and loss.

Want to know if your inventory-based business is turning a profit? You need to determine your cost of goods sold, or COGS. Calculating your cost of goods sold tells you how much it costs to create a product—so if you know your COGS, you know what price to sell your goods at to turn a profit.

If you're ready to dive right in, here's the COGS formula:

Cost of goods sold = beginning inventory + purchases – ending inventory

Of course, rather like the pure and simple truth, easy mathematical equations are rarely easy and never simple. Keep reading for our breakdown of each part of the COGS formula.

Understanding the COGS formula

Before you can calculate your cost of goods sold, you need to gather information on three crucial figures over a given time period:

  • Your beginning inventory, which is the total worth of all the inventory you have on hand at the start of the time period (including raw materials for not-yet-assembled goods, among other things)
  • The total cost of purchases made over that time period, which refers to any new inventory and materials you purchased plus any other direct expenses (expenses directly related to product creation)
  • Your ending inventory, or the total worth of your remaining inventory at the end of the time period

The time period you pick is up to you, but we recommend calculating your cost of goods sold at least quarterly. Running the formula once a month is a great way to stay on top of inventory costs—a particularly good idea if you've just gotten your business up and running. And you'll need to calculate your yearly COGS to accurately file your taxes at the end of the year.

Beginning inventory

Own a retail business? Determining your beginning inventory's value shouldn't be too complicated. For example, if you were a fabric store owner, you'd know exactly how much you paid your supplier for each bolt of cloth or skein of yarn. You'd simply add up how much it cost to acquire each product and, voilà, you've found your beginning inventory's total value.

If you don't just sell goods but also assemble raw materials to create goods, your inventory will include all the building blocks that make up your final product. For example, if you own a smoothie food truck, the cost of your frozen fruit would count as inventory.


Your purchases section should include all direct expenses, or expenses that relate directly to production. Common direct expenses include the following:

  • Wholesale inventory purchased during the time period
  • Parts and materials
  • Direct labor costs, or the wages you pay employees who assemble your products

If you can't directly tie a cost to product creation, it's an indirect cost that isn't included in your total purchases column. For instance, administrative costs (like board member salaries) are indirect costs that don't relate to the COGS formula. (You'll record indirect costs on your income statement, but again, they aren't relevant to calculating COGS, so feel free to set them aside for now.)

Ending inventory

Calculate your ending inventory using the same guidelines we outlined in the beginning inventory section above.

Alas, if this is the first time you're running a COGS formula, you'll have to calculate both your beginning and ending inventory. But from this point forward, you'll need to calculate only your ending inventory. Why? Because one period's ending inventory will always equal your beginning inventory for the next period.

Applying the COGS formula

COGS is an essential part of your company's profit and loss statements, one of the most crucial financial documents for any growing business. Profit and loss statements, which are also called income statements, list your revenue and expenses to calculate your net profit.

In turn, the net profit shows you, your investors, and other financial stakeholders (like banks) exactly how financially healthy your business is—which influences who invests in your business and how much.

A basic profit and loss statement has two main sections:

  • Revenue, which usually refers to profits from sales of goods or services
  • Expenses, which include wages for direct labor, equipment purchases, rent, and (for inventory-based businesses) COGS

At the bottom of the sheet, you'll subtract your expenses from your revenue to list your net profit.

Multi-step profit and loss statements are a little more complicated. Instead of listing COGS as an expense, these types of statements deduct COGS directly from sales revenue to calculate the business's gross profit. The statement then divides expenses into operating expenses (OPEX) and non-operating expenses.

Get the skinny on income statements

Income statements are one of the three most important financial documents in your repertoire—and learning how to draw one up is a crucial step in understanding your business's financial trajectory. To get more info on how to build your own report, check out our page on how to prepare an income statement.

Cost of goods sold FAQ

Does my business need to calculate COGS?

The cost of goods sold applies only to businesses that sell products. If your business is service based (like a psychology clinic or legal team), your direct costs don't come from sales of goods. Instead, your direct costs are any expenses related directly to your service. For instance, an outsourced accounting company would likely include its accounting software subscription as part of its direct costs.

What is the formula for COGS?

The formula for calculating COGS is beginning inventory + purchases – ending inventory.

What costs are included in the cost of goods sold?

Any costs that directly relate to selling your product should be considered part of your cost of goods sold. For example, if you pay employees to assemble your product, both the product's raw materials and the employees' wages are included in your cost of goods sold. These expenses are also known as direct expenses since they relate directly to your product's creation.

Best Bookkeeping Software
Best for collaboration
4.4 out of 5 stars
Zoho Books
Best automation
3.6 out of 5 stars
Best bookkeeping only
3.5 out of 5 stars
Learn more about our top brands.

The takeaway

Nothing beats the peace of mind you get from knowing exactly where your business stands financially—and if you own an inventory-based business, calculating your cost of goods sold is a crucial part of that financial serenity. Make sure to run the equation frequently to ensure your business is comfortably in the black or, if not, show you what changes you need to make to boost your profitability.

Want help tracking your business's finances? All five of our favorite small-business accounting solutions include detailed reporting that keeps you up to date on COGS and other key financial calculations.


At, our research is meant to offer general product and service recommendations. We don't guarantee that our suggestions will work best for each individual or business, so consider your unique needs when choosing products and services.

Kylie McQuarrie
Written by
Kylie McQuarrie
Kylie McQuarrie has been writing for and about small businesses since 2014. Prior to writing full-time, she worked with a variety of small-business owners (from freelance writers to real-estate solopreneurs), which gave her a front-row look at small-business owners' struggles, frustrations, and successes. Currently, she’s’s accounting and payroll staff writer. Her work has been featured on, G2, and Fairygodboss, among others.
Recent Articles
How to conduct payroll audit
How to Conduct a Payroll Audit for Small Business
A company’s biggest cost can be payroll. Audits prevent fraud, save money, and keep costs...
notion for business
6 Ways Experts Use Notion to Manage Their Small Businesses
Are you interested in using Notion to set up a comprehensive workplace for your small...
Woman in coffee shop comparing Gusto Payroll and Patriot Payroll
Patriot Payroll vs. Gusto Payroll 2021
Gusto and Patriot Software are two of the best payroll software picks for small businesses....
Close-up of a white woman's hands as she signs a cheque with a pen
Paycor Payroll Review 2021
Paycor’s HR add-ons elevate its basic payroll features for businesses with 10 or fewer employees,...