COGS Calculator

Calculate your cost of goods sold in seconds. Enter beginning inventory, purchases, and ending inventory to find your COGS and understand your true product costs for pricing and tax decisions.

COGS Calculator

If you sell products, you need to know what those products actually cost you. Not what you think they cost—what they actually cost once you factor in everything.

This calculator does exactly that. Enter your beginning inventory, what you purchased during the period, and what's left on your shelves. You'll get your cost of goods sold (COGS)—the number that tells you whether you're actually making money on what you sell.

It takes about 30 seconds, and the insight is worth far more than that.


What Exactly is Cost of Goods Sold?

Your cost of goods sold—COGS for short—is simply what you spend on the stuff you sell. Not your rent. Not your marketing. Not your accountant's fees. Just the direct cost of getting products into your customers' hands.

Here's a quick way to think about it: if you run a t-shirt shop, COGS is what you paid for those shirts. The shipping from your supplier counts. The screen printing counts. But your Shopify subscription? That's an operating expense—a different bucket entirely.

Why does this matter? Because COGS is fully tax-deductible. Every dollar you accurately track as COGS is a dollar you don't pay taxes on. I've seen business owners leave thousands on the table simply because they didn't categorize costs correctly. Don't be that person.

Three types of costs make up your COGS:

Direct Materials Whatever goes into your product or whatever you buy to resell. For a retailer, this is your wholesale cost. For a manufacturer, it's raw materials and components.

Direct Labor Wages for people who actually make your products. The person operating the sewing machine counts. The person answering phones doesn't.

Manufacturing Overhead The stuff that keeps production running—factory utilities, equipment wear and tear, supplies consumed during manufacturing. Your corporate office electric bill doesn't belong here.


The Formula (It's Simpler Than You'd Think)

Here's the formula:

COGS = Beginning Inventory + Purchases − Ending Inventory

That's it. No complex math. Let me break down what each piece means:

Component

What It Actually Means

Quick Example

Beginning Inventory

What you had on the shelves when the period started

$50,000 in products on January 1st

Purchases

Everything you bought during the period (including shipping to get it to you)

$120,000 in stock + $3,000 freight

Ending Inventory

What's still sitting there unsold at period end

$45,000 on December 31st

So using those numbers:

$50,000 + $123,000 − $45,000 = $128,000

That $128,000 is what you spent on products that actually walked out the door. Not inventory gathering dust—just the stuff customers bought.


How to Use This Calculator

Step 1: Grab your numbers You'll need three figures: what you started with, what you bought, and what you have left. Your last period's ending inventory becomes this period's beginning inventory—they should match exactly.

Step 2: Enter your beginning inventory This is your starting point. If you're calculating for Q1, it's what was on your shelves on January 1st.

Step 3: Add your purchases Total up everything you spent acquiring inventory. Here's where people mess up: include the freight charges to get products to you. The $800 you paid to ship inventory from your supplier? That's part of purchases. The $12 you charge customers for shipping? That's not.

Step 4: Enter what's left Count what's still sitting unsold. Yes, this means you need an actual inventory count or a tracking system you trust. Guessing here defeats the purpose.

Step 5: See your COGS The calculator handles the math. Use this number to figure out your gross profit, check your margins, and make sure you're not accidentally selling at a loss.


Real Examples from Real Business Types

Numbers make more sense in context. Here's how COGS works across five different businesses:

The Clothing Boutique

Sarah owns a women's clothing store in Austin. Here's her Q1:

  • Beginning Inventory: $45,000
  • Purchases: $28,000
  • Ending Inventory: $38,000
  • COGS: $35,000

Her Q1 sales hit $58,000, which means $23,000 in gross profit—a 39.7% margin. For retail clothing, that's solid. She's in the sweet spot.

The E-commerce Seller

Marcus sells specialty kitchen gadgets from his garage-turned-warehouse. His numbers look different because he has significant freight costs:

  • Beginning Inventory: $12,500
  • Product Purchases: $62,000
  • Freight-In: $5,000
  • Ending Inventory: $15,200
  • COGS: $64,300

See how he includes that $5,000 freight-in? That's shipping from suppliers to his warehouse. The shipping he pays to get orders to customers is a separate line item entirely. Mixing these up is one of the most common mistakes I see.

The Restaurant

Chen runs a casual dining spot. His food cost calculation is almost religious—he tracks it weekly:

  • Beginning Inventory: $8,000
  • Food Purchases: $24,000
  • Ending Inventory: $6,500
  • Food COGS: $25,500

Monthly food sales: $85,000. That puts his food cost at exactly 30%—right where it should be for casual dining. Go above 35% and margins start getting uncomfortable. Drop below 25% and customers might notice portion sizes shrinking.

The Small Manufacturer

Linda builds custom furniture in Portland. Her COGS includes materials and the people who build the pieces:

  • Beginning Materials: $125,000
  • Raw Materials: $280,000
  • Direct Labor: $60,000
  • Ending Inventory: $98,000
  • COGS: $367,000

That $60,000 in labor? It's for the craftspeople in her workshop who actually build furniture. Her office manager's salary isn't in there—that's overhead, not direct production cost.

The Service Business

"But I don't have inventory!" I hear this from consultants and agencies all the time. You still have COGS—you just call it something different.

David runs a web development agency:

  • Developer Salaries (Billable): $180,000
  • Freelance Contractors: $45,000
  • Software (Client Projects): $12,000
  • Cost of Services: $237,000

His developers' time on client projects counts. The project management software they use for client work counts. His office rent and his own salary as the owner? Operating expenses.


FIFO, LIFO, and Weighted Average (Yes, This Matters)

Here's where accountants start getting excited. If you buy the same product at different prices throughout the year—which, let's be honest, basically everyone does—you need to decide which cost applies when you sell something.

There are three ways to handle this:

FIFO: First In, First Out

You assume your oldest inventory sells first. During inflation (when your costs are rising), FIFO means you're assigning those older, cheaper costs to what you sold. Result: lower COGS, higher profits on paper.

Use FIFO if: You sell perishables, your inventory actually moves this way physically, or you want to show higher profits to investors or lenders.

LIFO: Last In, First Out

You assume your newest inventory sells first. When prices are rising, you're matching current (higher) costs against current revenue. Result: higher COGS, lower taxable profit.

Use LIFO if: You want to minimize taxes during inflation. Fair warning: LIFO is only allowed under US tax rules. If you operate internationally or might someday, this could create headaches.

Weighted Average

You calculate an average cost across all your inventory. Less precise than tracking specific batches, but way simpler to manage.

Use this if: You have lots of similar items and tracking individual purchase prices would drive you insane.

The Quick Comparison

Method

When Prices Rise...

Tax Bill

Hassle Factor

FIFO

Lower COGS, higher profit

Higher

Medium

LIFO

Higher COGS, lower profit

Lower

Higher

Weighted Average

Somewhere in between

Medium

Lowest

One critical note: once you pick a method, stick with it. The IRS doesn't like businesses hopping between methods to game their taxes. You can change, but you'll need permission and a good reason.


The Cheat Sheet: What Goes In COGS (And What Doesn't)

This is where things get messy in real life. Here's the definitive list:

Put These IN Your COGS


Cost

Why It Counts

Product/wholesale cost

Obviously—it's the thing you're selling

Raw materials

What your product is made of

Freight-in (shipping TO you)

Cost to get inventory to your location

Direct production labor

People who make the products

Manufacturing supplies

Stuff consumed during production

Import duties/customs

Direct cost of acquiring goods

Factory rent & utilities

Only if it's where production happens

Keep These OUT of COGS

Cost

Where It Actually Goes

Shipping to customers

Shipping expense

Sales commissions

Selling expense

Marketing and ads

Marketing expense

Your salary (unless you're on the production line)

G&A expense

Office rent

Operating expense

Storage after production

Warehousing expense

Loan interest

Interest expense

The rule of thumb: Would this cost exist if you didn't make or buy this specific product? If no, it's probably COGS. If yes, it's probably operating expense.


How Does Your COGS Stack Up?

Here's what's normal across different industries:

Industry

Typical COGS %

What's Going On

Grocery stores

70-80%

Razor-thin margins, massive volume

Manufacturing

60-70%

Materials + direct labor add up

Retail clothing

50-60%

Room for markup, but not huge

E-commerce

40-60%

Wild variation by product category

Restaurants (food only)

28-35%

Labor is separate—this is just food

SaaS companies

15-25%

Hosting, support, implementation

Professional services

20-40%

Mainly billable labor costs

If you're way above your industry benchmark, look for ways to reduce costs—better supplier deals, less waste, more efficient production. If you're significantly below, either you've found a competitive advantage worth protecting, or you're not capturing all your direct costs.


Why COGS Actually Matters for Your Business

This isn't just accounting busywork. Getting COGS right impacts three things you care about:

Your Tax Bill

COGS comes straight off the top of your revenue before you calculate taxable income. Let's say you made $500,000 in sales. If you properly track $300,000 in COGS, you're taxed on $200,000 gross profit (minus operating expenses).

But if you miss $50,000 in legitimate COGS? You just paid taxes on $50,000 of "profit" you didn't actually make. At a 25% tax rate, that's $12,500 you handed the IRS for no reason.

Your Pricing

COGS sets your pricing floor. If a product costs you $45 in COGS and you need a 40% gross margin to cover overhead and make a profit, your minimum price is $75. Without accurate COGS, you're pricing blind—and I've seen businesses accidentally sell products at a loss for months before realizing it.

Your Product Decisions

Not all products are created equal. That bestseller with huge volume might actually have the thinnest margins, while a slower-moving item could be your profit champion. You can't know this without product-level COGS tracking. This data drives smarter decisions about what to stock, what to promote, and what to quietly discontinue.


This calculator gives you accurate COGS based on the numbers you enter. For help choosing inventory valuation methods, categorizing tricky costs, or setting up proper tracking systems, it's worth a conversation with a bookkeeper or accountant who knows your industry.

Frequently Asked Questions

What exactly is included in cost of goods sold?

Everything directly tied to making or buying what you sell: product costs, raw materials, freight to get inventory to you, production labor, and manufacturing overhead. The test is simple—if the cost wouldn't exist without that specific product, it's probably COGS.

What's the difference between COGS and operating expenses?

COGS is about products. Operating expenses are about running the business. Your wholesale product cost is COGS. Your office rent is operating expense. Here's the clearest way to think about it: if you stopped selling products tomorrow, COGS would disappear. Operating expenses would keep coming.

I don't have ending inventory numbers. Can I still estimate COGS?

You can get close by working backward from your gross margin. If you know you typically run a 40% gross margin and you had $100,000 in sales, your COGS is roughly $60,000. But this is an estimate—it's not a substitute for actually counting your inventory.

FIFO or LIFO—which inventory method should I pick?

Depends what you're optimizing for. FIFO shows higher profits (good for impressing investors or lenders). LIFO reduces taxes during inflation (good for keeping more cash). Weighted average is easiest to manage. Most small businesses go with FIFO. Whatever you choose, talk to your accountant first—switching later is a hassle.

Is COGS tax deductible?

100%. It's subtracted from your revenue before calculating taxable income. Accurate COGS tracking literally reduces your tax bill dollar-for-dollar. This is why getting it right matters so much.

My business is service-based. Do I even have COGS?

Yes, but you might call it "cost of services" or "cost of revenue." Include billable employee salaries, contractor payments, and software used specifically for client delivery. A web agency would include developer time on client projects. A consulting firm would include consultant hours. Your office manager's salary wouldn't count.

What COGS percentage should I be targeting?

It varies wildly by industry. Restaurants aim for 28-35% (food only). Retail clothing runs 50-60%. SaaS companies often see 15-25%. Compare yourself to similar businesses, but don't obsess over hitting an exact number—your specific business model matters more than industry averages.

My COGS is higher than my sales. What's wrong?

You're selling below cost, which isn't sustainable. Most common causes: pricing mistakes, inventory shrinkage (theft or damage), untracked markdowns, or plain old data entry errors. Start by checking your numbers for obvious mistakes. If the math is right, you've got a pricing problem that needs immediate attention.

How often should I be calculating COGS?

At minimum, every accounting period—monthly, quarterly, or annually. Monthly is better because you'll catch problems faster. Restaurants and retailers often track weekly because inventory moves fast and spoilage is real. If you're running tight margins, more frequent tracking pays off.

What happens if I get COGS wrong?

Nothing good. Your gross profit numbers will be wrong. Your pricing decisions will be based on bad data. Your tax returns will be inaccurate—which could mean overpaying or, worse, triggering an audit when you underpay. The time you invest in tracking COGS accurately is time well spent.