Cost of Goods Sold Formula: How to Calculate COGS Step by Step With Examples, Inventory Methods, and Journal Entries

You sold $50,000 last month. Your bank balance looks healthy. Then your accountant asks one question. What did those sales actually cost you to produce? The room goes quiet. Most owners track revenue with ease. Few can explain their true product cost. That gap is expensive. It hides your real profit. It inflates your tax bill. The cost of goods sold formula closes that gap. It tells you what each sale costs to deliver. This guide breaks down the cost of goods sold formula step by step. You will learn the math, the methods, and the mistakes to avoid.

The cost of goods sold formula

What Is Cost of Goods Sold (COGS)?

Every product business spends money to make a sale. That spending has a name. Understanding it is the first step toward real profit clarity. So let us define it in plain English before we touch the cost of goods sold formula.

Cost of goods sold is the direct cost of producing the goods a business sells during a period. It includes raw materials, direct labor, and production costs tied to each unit. It excludes overhead like marketing, rent, and admin salaries. In plain terms, it is what your sold products cost you.

That is the cogs meaning in one line. The cogs definition matters because it separates two kinds of spending. Direct costs go into COGS. Indirect costs do not. This is why COGS is never the same as your total expenses.

Here is the distinction that trips people up:

  • Direct costs: tied to making a product, such as materials and factory labor.
  • Indirect costs: keep the business running, such as office rent and advertising.

Many owners confuse COGS with similar terms. The table below clears it up.

Term What it covers Best fit
Cost of goods sold Direct cost of physical products sold Retail, manufacturing, e-commerce
Cost of sales Same idea, broader wording Mixed product and service firms
Cost of revenue Direct cost of delivering a product or service SaaS, agencies, service businesses

On the income statement, COGS sits right under revenue. You subtract it from revenue to get gross profit. So its placement is not random. It is the first cost that touches your top line. As a rough guide, COGS often lands somewhere between 50% and 65% of revenue for many product businesses. This varies widely by sector, so treat it as a starting reference, not a rule.

Need clean numbers before you measure anything? Our bookkeeping services keep your records accurate and ready to report.

The Cost of Goods Sold Formula

Now for the part you came for. The cost of goods sold formula is short. It is also powerful. Once you know the inputs, you can run it in minutes. The standard cogs formula works for retail, wholesale, and most product sellers.

Here is the primary cost of goods sold equation:

COGS = Beginning Inventory + Purchases – Ending Inventory

Each input is simple once defined:

  • Beginning inventory: the value of stock you held at the start of the period.
  • Purchases: the cost of new stock or materials bought during the period.
  • Ending inventory: the value of stock left unsold at the end of the period.

[Suggested visual: a three-block diagram showing Beginning Inventory plus Purchases minus Ending Inventory equals COGS.]

Manufacturers use a different lens. Their cost of goods sold formula manufacturing version focuses on production inputs:

COGS = Direct Materials + Direct Labor + Other Direct Production Costs

There is also a reverse method. Use it when you already know your sales and gross profit:

COGS = Revenue – Gross Profit

This cost of goods sold formula with sales and gross profit is handy for quick checks. If revenue is $100,000 and gross profit is $40,000, then COGS is $60,000. The formula for cost of goods sold always ties back to the same logic. You are measuring what left your shelves and turned into a sale.

Selling across channels? Our e-commerce accounting team tracks inventory and COGS for Shopify, Amazon, and more.

How to Calculate Cost of Goods Sold Formula in 5 Steps

Knowing the cost of goods sold formula is one thing. Applying it cleanly is another. Here is how to calculate cost of goods sold without second-guessing your numbers. Follow these five steps in order, and the math takes care of itself.

  1. Value your beginning inventory. Use the figure that matches last period’s ending inventory.
  2. Add your purchases and production costs. Include materials and direct labor for the period.
  3. Value your ending inventory. Count what is left and price it with your chosen method.
  4. Apply the cost of goods sold formula. Beginning Inventory plus Purchases minus Ending Inventory.
  5. Reconcile to your income statement. Confirm the COGS figure flows into gross profit correctly.

That is how to calculate cogs in practice. Two worked examples make it concrete.

Worked Example 1, retail store. A clothing shop starts the quarter with $15,000 in stock. It buys $20,000 more during the quarter. It ends with $10,000 in stock.

  • COGS = $15,000 + $20,000 – $10,000 = $25,000

Worked Example 2, coffee shop. A cafe starts the month with $3,000 of beans, milk, and cups. It buys $8,000 more. It ends with $2,500 on hand.

  • COGS = $3,000 + $8,000 – $2,500 = $8,500

That is a clean cost of goods sold example for two very different businesses. The cost of goods sold calculation never changes. Only the numbers do.

Expert insight: The most common error is putting direct labor in operating expenses. If a worker physically makes or assembles your product, that wage belongs in COGS. Misfiling it inflates gross profit and distorts your margins.

Want this done for you each month? See our outsourced accounting services built for growing businesses.

What Is Included in Cost of Goods Sold Formula (and What Is Not)

The cost of goods sold formula is only as accurate as its inputs. Put the wrong cost in, and your profit picture breaks. So you need a clear line between what belongs in COGS and what does not. Use the checklist below before every close.

Included in COGS:

  • Raw materials and parts
  • Direct labor that makes the product
  • Packaging that ships with the product
  • Inbound freight to receive materials
  • Other direct production costs

Excluded from COGS:

  • Marketing and advertising
  • Admin and office salaries
  • Rent and utilities
  • Outbound distribution and selling costs
  • Research and development

Not sure where a cost lands? Run it through this simple decision test.

Is this cost a COGS? Ask three questions. Does the cost rise when you make more units? Does it attach directly to a product? Would it disappear if you stopped making the product? Two or more yes answers means it is COGS. Mostly no answers means it is an operating expense.

The table below sums up the split that drives every income statement.

Cost type Goes in COGS Goes in operating expenses
Raw materials Yes No
Factory or production labor Yes No
Marketing and sales No Yes
Office rent No Yes
Inbound freight Yes No

Messy categories slowing you down? Learn why many firms choose outsourcing over in-house accounting.

Inventory Valuation Methods: FIFO, LIFO, and Weighted Average

Your ending inventory value changes your COGS. That value depends on the method you pick. Three methods dominate inventory accounting. Each can produce a different cost of goods sold calculation from the very same stock. Let us apply one dataset to all three so the difference is obvious.

The three methods are simple to define:

  • FIFO (First In, First Out): the oldest stock is sold first.
  • LIFO (Last In, First Out): the newest stock is sold first.
  • Weighted Average Cost: every unit carries the same average cost.

You can run these on a periodic basis (updated at period end) or a perpetual basis (updated with every sale). Now to the numbers. A store buys widgets three times:

  • January: 100 units at $10 = $1,000
  • February: 100 units at $12 = $1,200
  • March: 100 units at $14 = $1,400

That is 300 units for $3,600. The store sells 200 units. It holds 100 units at period end. Here is the cost of goods sold formula applied under each method.

Method COGS on 200 units sold Ending inventory (100 units)
FIFO $1,000 + $1,200 = $2,200 $1,400
LIFO $1,400 + $1,200 = $2,600 $1,000
Weighted Average 200 × $12 = $2,400 $1,200

Notice the spread. The same stock gives three different COGS figures. In a period of rising prices, FIFO reports the lowest COGS and the highest profit. LIFO reports the highest COGS and the lowest taxable profit. Weighted average sits in the middle.

Method Pros Cons
FIFO Matches real stock flow, higher reported profit Higher tax in rising prices
LIFO Lowers taxable income in rising prices Banned under IFRS, complex tracking
Weighted Average Simple, smooths price swings Hides cost spikes

One key point on the fifo method and its rivals. LIFO is allowed in the United States but prohibited under IFRS. So global businesses often avoid it.

[Suggested visual: a flow graphic comparing FIFO and LIFO stock movement.]

Inventory eating your margins? Our e-commerce accounting services handle valuation and COGS across every sales channel.

How to Record COGS: The Journal Entry

Calculating cost of goods sold formula is only half the job. You also need to record it. The cost of goods sold journal entry moves cost out of inventory and into expense. The rule is short. Here is how to record cost of goods sold the right way.

The direct answer to the debit and credit question:

Debit Cost of Goods Sold. Credit Inventory.

Say you sold goods that cost you $2,200 under FIFO. The cogs journal entry looks like this.

Account Debit Credit
Cost of Goods Sold $2,200
Inventory $2,200

The recording timing depends on your system. Under a perpetual system, you post this entry with every sale. Under a periodic system, you calculate COGS at period end and post one entry. Most modern tools handle this for you. QuickBooks and Xero update the cost of goods sold journal entry automatically as you record sales. That removes manual error and keeps inventory accurate.

Want your entries posted right the first time? Explore our bookkeeping services and stop chasing reconciliation gaps.

Cost of Goods Manufactured Formula and the COGS Schedule

Manufacturers carry an extra layer. They make products before they sell them. So they track work in process first, then finished goods. This is where the cost of goods manufactured formula comes in. It feeds the cost of goods sold formula for any business that builds what it sells.

The building blocks are direct materials, direct labor, and manufacturing overhead. Add them to your work in process to find what you finished.

Cost of Goods Manufactured = Beginning WIP + Total Manufacturing Costs – Ending WIP

Then you convert finished output into COGS:

COGS = Beginning Finished Goods + COGM – Ending Finished Goods

Here is a full schedule of cost of goods sold formula for a small manufacturer.

Line item Amount
Beginning raw materials $5,000
Add: raw material purchases $20,000
Less: ending raw materials ($4,000)
Direct materials used $21,000
Add: direct labor $15,000
Add: manufacturing overhead $10,000
Total manufacturing costs $46,000
Add: beginning work in process $6,000
Less: ending work in process ($4,000)
Cost of goods manufactured $48,000
Add: beginning finished goods $8,000
Less: ending finished goods ($7,000)
Cost of goods sold $49,000

Look closely at the last two lines. COGM is $48,000. COGS is $49,000. They differ because the business sold more than it produced this period. It drew down finished goods inventory. So production and sales rarely match exactly, and that is why these two figures live on separate lines.

Scaling a product line? Our virtual CFO services turn cost data into pricing and growth strategy.

Cost of Goods Sold for Service Businesses

Can a service business have COGS? Yes, in a sense. Service firms call it cost of sales or cost of revenue. The idea is the same. It is the direct cost of delivering the service you billed for.

Think of an agency. Its cost of revenue includes the salaries of staff who do client work. It also includes subcontractor fees and project tools. It does not include the sales team or the office lease. A contractor follows the same logic. Direct labor and materials on a job are cost of revenue. The truck payment and the back office are not.

Run a service firm? Our outsourced accounting services map your direct costs so your margins are clear.

Why the Cost of Goods Sold Formula Matters: Profit, Pricing, and Taxes

COGS is not just a number on a statement. It drives three big decisions. Get it right and you price with confidence. Get it wrong and you guess. So the cost of goods sold formula deserves a regular review, not a once-a-year glance.

Start with profit. Gross profit equals revenue minus COGS. Your gross margin percentage shows how much of each sale you keep before overhead. Watch that margin month over month. A falling margin signals rising costs or weak pricing.

Pricing comes next. You cannot set a smart price without knowing your unit cost. COGS gives you the floor. Price below it and every sale loses money. Track it and you find your break-even point fast.

Then there are taxes. COGS reduces your gross receipts, which lowers taxable income. In the United States, sole proprietors report it on Schedule C. Corporations and many others use IRS Form 1125-A. Accurate records here protect your deductions and your filing. Always confirm current rules with a tax professional before you file.

Worried about deductions and compliance? Our tax services keep your filings accurate and your COGS defensible.

Common Cost of Goods Sold Mistakes (Myth vs Fact)

Even careful owners slip up on COGS. Small errors compound into big distortions. Here are the traps to watch, framed as myth versus fact so the truth is easy to extract.

  • Misallocating labor. Production wages belong in COGS, not operating expenses.
  • Ignoring shrinkage. Theft, spoilage, and write-downs must reduce inventory.
  • Mixing cash and accrual. Match costs to the period the sale happened.
  • Forgetting freight. Inbound freight to receive stock is part of COGS.

Myth: COGS is just whatever you spent on inventory this month. Fact: COGS is the cost of inventory you actually sold, not what you bought. Purchases only matter through the cost of goods sold formula.

Two quick formula notes worth knowing. The variable cost of goods sold formula isolates only the costs that change with output, such as materials and per-unit labor. The adjusted cost of goods sold formula refines the base figure for freight-in, purchase returns, and discounts. Both sharpen accuracy when stakes are high.

Real-World COGS Examples Across Industries

The cost of goods sold formula looks the same on paper. In practice, every industry applies it differently. Here are three real-time examples that show how the cost of goods sold calculation plays out day to day.

  • E-commerce. A Shopify store reconciles Stripe payouts against orders. The team strips out merchant fees, then maps product cost, packaging, and inbound freight into COGS. Clean payout reconciliation is what makes the COGS figure trustworthy.
  • Real estate. A property firm maps its rent roll income against property-level expenses. Direct costs tied to a managed unit feed the cost of revenue. Overhead like the head office stays separate.
  • Clinics. A medical practice tracks insurance payments alongside payroll compliance. Direct clinical labor and supplies behave like cost of revenue. Front-desk admin and rent do not.

Our Compliance and On-Time Delivery Guarantees

Getting the cost of goods sold formula right is about more than math. It is about trust in your numbers when a deadline or an audit arrives. That is the pain we built our promises around. You hire help to remove risk, not add it. So we stand behind our work in writing.

  • Regulatory Compliance Assurance. We ensure all tax filings, payroll, and financial reports meet compliance standards. If an error on our part results in a financial penalty, we will cover the cost. Your books are our responsibility.
  • Financial Reports Delivered on Schedule. We deliver monthly, quarterly, and annual reports without delays. If we miss a compliance deadline due to our fault, we pay a 50% fee. On-time delivery is not a hope. It is a guarantee.

Want that peace of mind? Compare our transparent pricing plans and pick the support level that fits.

Conclusion: Master Your Cost of Goods Sold Formula

The cost of goods sold formula is one of the most useful tools you own. It turns raw spending into real profit insight. Beginning Inventory plus Purchases minus Ending Inventory gives you COGS. From there, you can price, plan, and file with confidence.

Key takeaways to remember:

  • COGS captures direct product costs only, never overhead.
  • The core cost of goods sold formula is Beginning Inventory + Purchases – Ending Inventory.
  • FIFO, LIFO, and weighted average each change your reported COGS.
  • Record it as a debit to COGS and a credit to Inventory.
  • Accurate COGS protects your margins, your pricing, and your tax position.

You do not have to manage this alone. We will review your current books and show you exactly what we can clean up and automate in 30 days. Stop guessing at your margins and start scaling with clear numbers.

Book a free consultation and let us take COGS tracking off your plate.

Frequently Asked Questions – Cost of Goods Sold Formula

What is cost of goods sold?

Cost of goods sold is the direct cost of producing the goods you sold in a period. It covers materials, direct labor, and production costs. It excludes overhead like marketing and rent.

Is cost of goods sold an expense?

Yes. COGS is an expense account. It appears on the income statement just below revenue and reduces your gross profit.

What does COGS stand for?

COGS stands for cost of goods sold. It is sometimes called cost of sales.

Is COGS a debit or credit?

COGS carries a debit balance. When you record a sale, you debit Cost of Goods Sold and credit Inventory.

What type of account is cost of goods sold?

It is an expense account. More precisely, it is a direct cost account that sits between revenue and gross profit.

What is included in cost of goods sold?

Raw materials, direct production labor, packaging, inbound freight, and other direct production costs. Marketing, admin salaries, and rent are not included.

Is cost of revenue the same as COGS?

They are close cousins. COGS usually refers to physical products. Cost of revenue is the broader term used by service and software businesses for the direct cost of delivery.

How do you determine cost of goods sold?

Apply the cost of goods sold formula. Take your beginning inventory, add purchases, then subtract ending inventory. The result is your COGS for the period.

Contents

Liked it?

You can subscribe to our newsletter and get notified about new articles

Share it with friends
More like this
Shopify Accounting in 2026 The Store Owner's Complete Guide to Clean Books, Bigger Profit, and Zero Tax Surprises
7 min read

Your Shopify dashboard shows $48,000 in sales. Your bank shows a $41,300 deposit. Where did the...

Bookkeeping for Chiropractors The 2026 Guide to Clean Books, Lower Taxes, and a Practice That Pays You
15 min read

Your schedule is packed. You adjusted 42 patients today. So why does your bank balance not...

Bookkeeping for Therapists The Complete Guide for Private Practice to Keep Your Private Practice Books Clean
12 min read

You finished your last session at 7 PM. Now you are staring at a shoebox of...

Scroll to Top