How to Calculate the Cost of Goods Sold

If you own an inventory-based business, calculating the cost of goods sold (COGS) is crucial to understanding your profit and loss. In this article, we’ll cover how to calculate COG and provide you with a cost of goods formula to get you started.

We are committed to sharing unbiased reviews. Some of the links on our site are from our partners who compensate us. Read our editorial guidelines and advertising disclosure.

Play Video

Every small business owner needs to know if their inventory-based business is profitable. In order to know how to make your business profitable, you first 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.

Here's the cost of goods formula (COGS formula):

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

While the COGS formula is simple, implementing it is not always easy. Many small business owners use bookkeeping software to streamline this process and to track each item in this formula. This can make calculating COGS much easier for your business . 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 you want to calculate your cost of goods sold at least quarterly. Once the data has been collected, we recommend running the formula once a month. That is a great way to stay on top of inventory costs and is a good idea if you've just gotten your business up and running. As well, you will need to calculate your yearly COGS to accurately file your taxes at the end of the year.

Beginning inventory

As stated above, your beginning inventory is the first critical figure to understand. 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 add up how much it cost to acquire each product, and 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.

Purchases

The next part is calculating all of the relevant business purchases. Your purchases section should include all direct expenses, or expenses that relate directly to production. Common direct expenses include:

  • 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

The final part of calculating your COGS is to calculate your ending inventory. You can easily calculate your ending inventory by doing the following:

  • Perform a physical inventory count at the end of your accounting period
  • Tally up the cost of each item that you still have in stock (including raw materials, work-in-progress goods, and all finished goods)

Remember to use the actual cost you paid for each product. As an example, if you have 100 units of a specific product left, and each unit costs you $5, your ending inventory would be calculated as shown below:

  • 100 x $5 = $500

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

Expert Advice, Straight to Your Inbox
Gain confidence in your business future with our weekly simple solutions newsletter.

By signing up I agree to the Terms of Use and Privacy Policy.

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
Bell

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
Xero
Best for freelance
Wave
Budget pick
Learn more about our top brands.

The takeaway

When a small business understands how to properly calculate the cost of goods sold (COGS), they are able to make decisions that lead to running a profitable inventory-based business. Mastering the COGS formula will give you more precise insights into your business costs. This will help you make informed pricing, budgeting, and other financially related decisions.

Keeping your business accounting in order is important. A good accounting software can help. Learn more about the best business accounting software available to you and uncomplicate your business accounting today.

Compare the best bookkeeping software for small businesses

Bookkeeping software
Starting price
User limit (basic plan)
Expense tracking (basic plan)
Key reports
Get started
$15.00/mo.* 1 user + accountant access
Icon Yes  DarkYes
Sales tax, accounts receivable, inventory
$13.00/mo.Unlimited users
Icon No  DarkNo
Customized performance tracking
$0.00/mo.**Unlimited users (addt'l fee)
Icon Yes  DarkYes
Sales reports by customer, sales rep, or item
Free for lifeUnlimited users
Icon Yes  DarkYes
Basic financial reports only
$10.00/mo.1 user + accountant access
Icon Yes  DarkYes
Cash flow forecasting

Data as of 3/20/23. Offers and availability may vary by location and are subject to change.
*Current promotion: 50% off for three months or 30-day free trial
**Available only for businesses with less than $50K USD in annual revenue

Disclaimer

At Business.org, 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
Former Business.org staff writer Kylie McQuarrie has been writing for and about small businesses since 2014. Her work has been featured on SCORE.org, G2, and Fairygodboss, among others. She's worked closely with small-business owners in every industry—from freelance writing to real-estate startups—which has given her a front-row look at small-business owners' struggles, frustrations, and successes.
Recent Articles
Featured image of two men and a woman looking at boxes stored in a warehouse
How to Calculate the Cost of Goods Sold
If you own an inventory-based business, calculating the cost of goods sold (COGS) is crucial...
Best-Payroll-Software-for-Small-Business-on-laptop-screen
Best Payroll Software for Small Business 2025
We looked at 20 of the most popular payroll programs in the US, to rate...
A black male waiter serves a group of black and white women eating at a restaurant
The 9 Best Payroll Software for Restaurants 2023
We looked at and assessed the top payroll brands’ prices, plans, payroll and HR features,...
A Black woman in a pink sweater sits at a table calculating sums
Gusto Payroll Review 2025
In our Gusto review, we dive into pricing, payroll and HR features, customer reviews, and...