Use this calculator to compute your cost of goods sold for the period>
Enter beginning inventory value, total purchases or production costs, and ending inventory value. Add your revenue for the same period. Click calculate.
The calculator shows your COGS, gross profit, gross margin percentage, and how much revenue goes to production costs. A breakdown lists every component so you see where money went.
AI Analysis

The AI looks at your actual cost structure and tells you what’s wrong. It compares your margin to what healthy businesses in your model should hit. If you’re running a SaaS company at 50% margin, it calls that out as agency-level economics, not software. If you’re manufacturing at 15% margin, it tells you that paid advertising will drain cash faster than you can recover it.
The analysis pulls your specific numbers: revenue, COGS, gross profit percentage, and COGS ratio. For SaaS, it breaks down infrastructure cost, API spend, support cost, and payment fees separately. For physical products, it focuses on inventory flow and production expense. Then it identifies which line item is eating your profit and gives you 2-3 direct fixes based on what your business can actually afford to change.
What Exactly is COGS?

Cost of Goods Sold (COGS) represents the direct costs of producing the goods sold by a company. In simpler terms, it’s the total cost of creating the products you sell during a specific period.
Think of it this way: COGS is the money spent on materials and labor that went directly into making a specific product. It does not include every business expense, like your marketing budget or website hosting fees. Those are separate operating expenses. COGS focuses solely on the cost of production.
What Costs Are Included in COGS?

Many business owners find the line between a production cost (COGS) and an operating expense blurry. A clear distinction is crucial for accurate financial reporting. To clarify, ask yourself: “Was this cost directly required to create the finished product?”
Direct Costs (Included in COGS)
These are expenses you can directly trace to a product’s creation.
- Direct Materials: This is the cost of all raw materials and parts used to create your product. For Badger’s Beard Balms, this would be the beeswax, jojoba oil, essential oils, and the metal tins.
- Direct Labor: This includes wages for employees physically involved in turning raw materials into a finished product. For our balm business, it’s the salary of the person mixing the balm and pouring it into tins. It does not include the salary of the marketing manager.
- Manufacturing Overhead: These are indirect costs for running your production facility. They are not tied to a single unit but are necessary for production. This includes rent for your workshop, factory utilities, and depreciation on manufacturing equipment.

Indirect Costs (Excluded from COGS)
These expenses are not directly tied to production. They are needed to run the business as a whole but not to create the product. These are often called Selling, General, & Administrative (SG&A) expenses.
- Selling Expenses: Costs related to marketing and selling, such as online ads, sales commissions, and shipping to the customer.
- General & Administrative Expenses: The day-to-day costs of running the business. This includes office rent, salaries for administrative staff, and accounting fees.
Here is a simple breakdown for quick reference:
| Included in COGS (Direct Costs) | Excluded from COGS (Operating Costs) |
|---|---|
| Raw Materials (oils, wax, tins) | Marketing and Advertising Costs |
| Production Labor (balm mixer) | Sales Team Salaries & Commissions |
| Factory Rent & Utilities | Corporate Office Rent |
| Depreciation of Factory Equipment | Administrative Staff Salaries |
| Supplies for Production | Shipping Costs to the Customer |

The Equation for Cost of Goods Sold
The standard formula for finding your Cost of Goods Sold is straightforward. It relies on your inventory figures:
Beginning Inventory + Purchases – Ending Inventory = COGS
Let’s break that down:
- Beginning Inventory: This is the total value of your inventory at the start of an accounting period. Your beginning inventory for one period is your ending inventory from the previous one.
- Purchases: This is the cost of new raw materials or finished goods you bought during that same period.
- Ending Inventory: This is the value of inventory you have left at the end of the accounting period.
The logic is simple. You start with some inventory, add more, and whatever isn’t left at the end must have been sold.
How Inventory Value is Determined

The value you assign to your inventory can change, which affects the final COGS figure. This is especially true when raw material prices fluctuate. Businesses use a few accounting methods to manage this.
- FIFO (First-In, First-Out): This method assumes the first items you purchased are the first ones you sold. Imagine you bought beeswax in January for $10/lb and in February for $12/lb. FIFO assumes you used the older, $10 wax. During times of rising prices, this results in a lower COGS and higher reported profit.
- LIFO (Last-In, First-Out): This method assumes the opposite—that the last items you bought are the first you sold. Using the same example, LIFO assumes you used the newer, $12 wax. This method is less common and is not permitted under International Financial Reporting Standards (IFRS).
- Weighted-Average Cost: This method takes the total cost of all available goods and divides it by the total number of units. This creates an average cost per unit.
For most small businesses, FIFO is the most common and intuitive approach.
Improve your business’s profitability

Finding Your Gross Profit
Gross profit is the profit a company makes after subtracting the costs of making and selling its products. It is a top-line measure of profitability.
- Formula:
Revenue - COGS = Gross Profit
Determine Your Gross Profit Margin
The gross profit margin turns this number into a percentage. This makes it easier to track over time and compare with competitors.
- Formula:
(Gross Profit / Revenue) * 100% = Gross Profit Margin
Frequently Asked Questions (FAQ)

Why does the calculator show COGS percentage of revenue?
Because the dollar amount alone doesn’t tell you if your costs are healthy. A $10,000 cost of goods sold looks different at $15,000 revenue versus $50,000 revenue.
The percentage shows how much of every dollar goes to production. If cost is 70% of revenue, you keep 30 cents per dollar. That’s a 30% gross margin. Low margin means less money for marketing, operations, and profit.
Tracking this percentage over time catches problems early. Cost percentage creeping up? Material prices might be rising or production getting less efficient. Cost percentage dropping? You negotiated better rates or raised prices successfully.
The calculator displays this automatically after you enter your numbers. You don’t need to calculate it separately. The AI uses this percentage to determine if your margins support scaling or if you’re operating too tight to grow profitably.
How often should I run this calculation?
Monthly tracking catches margin problems fast. You spot material price increases, production inefficiency, and inventory shrinkage before they compound into real damage.
Quarterly works if costs stay stable. If you’re not making pricing decisions often, quarterly gives you enough data to see trends without constant calculation.
Annual is required for tax filing but useless for running the business. A year is too long. By the time you see a margin problem, you’ve already lost twelve months of profit.
What does it mean if my result is negative?
A negative number signals an error. It means your ending inventory is valued higher than beginning inventory plus purchases combined. This doesn’t happen in normal operations.
Common causes: You counted ending inventory incorrectly and inflated the value. You forgot to record purchases during the period. You changed valuation methods mid-period without adjusting. You miscategorized a credit or return as a purchase.
How to fix it: Recount ending inventory physically. Review all purchases for the period. Look for data entry errors in your accounting system. Verify you used the same valuation method as the previous period.
Negative cost of sales destroys your financial statements. Gross profit becomes artificially inflated. Taxes get miscalculated. Fix it immediately before closing the books.
What if my result seems too high or too low?
High cost relative to revenue means your gross margin is shrinking. Material costs might have increased without corresponding price raises. Production could be less efficient. Inventory shrinkage from theft or damage adds up. You might have miscategorized operating expenses as purchases.
Low cost relative to revenue means your gross margin expanded. Maybe you negotiated better material prices. Production efficiency improved. You raised prices without cost increases. Or your ending inventory is overvalued.
How does the AI determine if my margins are healthy?
It compares your gross margin to established benchmarks for your business type. Different models require different margins to survive.
SaaS at 75%+ margin is healthy. True software economics. You can spend on customer acquisition and still make money. SaaS at 50-60% margin is okay but heavy. Infrastructure or support costs are high. Below 50% is agency-level. You’re spending too much to deliver the product.
Physical products at 40%+ margin is solid. Room for advertising, operations, and growth. 20-40% margin is tight. You can sell but scaling paid traffic feels expensive. Below 20% is weak. Barely keeping anything after production costs.
The AI applies these benchmarks to your calculated numbers. It tells you where you fall and what that means for your ability to scale. If margins are too thin, it identifies which cost line is the problem and suggests what to fix first.
What does the breakdown section show me?
Every input you entered, listed in order. Beginning inventory, purchases, ending inventory. Or for SaaS: infrastructure, API costs, support, payment fees. Then the calculated results: total cost of goods sold, revenue, gross profit, gross margin percentage, and cost ratio.
This lets you see where money went. If total cost looks wrong, scan the breakdown. One line is usually inflated or miscategorized. Maybe you included operating expenses in purchases. Maybe ending inventory got counted twice.
The breakdown also helps you spot which component is growing. If API costs jumped 50% month-over-month, that shows up clearly. If material purchases doubled but revenue only grew 20%, you see the mismatch immediately.
Use the breakdown to verify inputs before trusting the results. Check each line. Does beginning inventory match last period’s ending? Do purchases include only production costs? Is ending inventory counted correctly? Fix errors here before asking the AI to analyze.
What happens if the AI analysis says my margins are too low?
It tells you which cost component is killing profit and gives 2-3 direct fixes ranked by impact.
For SaaS, it might flag infrastructure costs as too high relative to revenue. The fix: negotiate better hosting rates, optimize resource usage, or move to cheaper providers. Or it might call out support costs. The fix: build better onboarding, create self-service documentation, or automate common support tasks.
For physical products, it might identify material costs as the problem. The fix: negotiate with suppliers, find alternative materials, or raise prices to protect margin. Or it might flag production inefficiency. The fix: train workers better, optimize workflow, or invest in automation.
The AI doesn’t just say “your margins are low.” It identifies the specific line eating your profit and tells you what to change first. Act on the top recommendation. Recalculate next period. See if the margin improved. Repeat until margins support growth.
Can the calculator help me decide if I can afford paid advertising?
Yes. The gross margin percentage tells you how much room you have for customer acquisition costs.
If gross margin is 60% and you want to spend 30% of revenue on ads, you have 30% left for operations and profit. That works. If gross margin is 25% and you want to spend 30% on ads, the math doesn’t work. You’d lose money on every sale.
The AI analysis explicitly addresses this. It checks whether your margins support paid marketing at scale. Low margins get flagged with a warning that advertising will drain cash faster than you recover it.
Run the calculator before launching paid campaigns. Know your margin. Calculate how much you can afford to spend acquiring customers. If the margin is too thin, fix costs first. Then advertise. Otherwise you’re just buying revenue that costs more than it’s worth.
How do I use the calculator results to improve profitability?
Start with the AI analysis. It identifies which cost is the problem. Fix that one first. Don’t try to optimize everything at once.
High material costs? Negotiate with suppliers or find alternatives. High infrastructure costs? Optimize hosting or switch providers. High support costs? Build better documentation or automate responses.
After you implement a fix, run the calculator again next period. Compare the results. Did gross margin improve? Did the problematic cost decrease as a percentage of revenue? If yes, the fix worked. If no, try the next recommendation.
Track the breakdown over time. Month-over-month changes show trends. Purchases increasing while revenue stays flat? Production is getting more expensive. Support costs climbing? You’re adding resources faster than users.



