How to calculate COGS

COGS (calculation)

There are two formulas for COGS (cost of goods sold) calculations. One is more commonly used by retailers, the other by manufacturers.

Retailer COGS formula

Cost of goods sold formula used by retailers for inventory accounting.

Why retailers use this COGS formula

You will notice that the cost-of-goods-sold formula makes no reference to the number of sales. Instead, it focuses on the value of inventory at the beginning and end of the sales period. Doing it this way helps to account for inventory that is discarded due to damage, and changes in wholesale prices.

An ecommerce business may choose to add shipping and transaction fees to their COGS seeing as they’re a characteristic of every sale.

Manufacturer COGS formula

Manufacturers have more complex supply chains. It makes sense for them to add up all the costs on their product’s journey to the customer. Be aware that some choose not to count warehousing or freight.

See related terms

Handy resources

Advisor directory

You can search for experts in our advisor directory

Find an advisor

Xero Small Business Guides

Discover resources to help you do better business

See all our guides & articles

Online accounting with Xero

Automate your accounting in the cloud

Find out more


This glossary is for small business owners. The definitions are written with their requirements in mind. More detailed definitions can be found in accounting textbooks or from an accounting professional. Xero does not provide accounting, tax, business or legal advice.