Gross margin is the single most important number on a product's income statement. It tells you how much of every dollar of sales survives after you pay the direct cost of making the product. A 40% gross margin means that for every $100 you bring in, $40 is left to cover rent, payroll, marketing, taxes, and profit — and $60 was spent building the thing you sold.
This gross margin calculator takes your total revenue and your cost of goods sold (COGS) and instantly returns three numbers: gross profit, gross margin percentage, and markup. Because margin and markup are two sides of the same coin — measured against revenue versus measured against cost — the calculator shows both so you stop mixing them up.
How to Use
- Enter your Total Revenue for the period — usually a month, quarter, or full year. Use net sales (after returns and discounts), not gross invoices.
- Enter your Cost of Goods Sold (COGS). This is only the direct cost of the goods you actually sold: raw materials, direct factory labor, and manufacturing overhead. Do not include rent, sales salaries, advertising, or software subscriptions — those are operating expenses, not COGS.
- Enter Units Sold for the same period. Leave it at 1 if you are entering total period figures and only care about the overall margin. The field drives the per-unit economics: revenue per unit, COGS per unit, and gross profit per unit.
- Read the result card:
- Gross Profit is the dollar amount left after COGS: revenue minus cost.
- Gross Margin is gross profit as a percentage of revenue — the headline ratio investors compare across companies.
- Markup on Cost is gross profit as a percentage of what you paid to make the product — the number retailers and manufacturers use when setting prices.
- Per Unit figures show the average revenue, cost, and profit on a single item — useful for pricing a new SKU or comparing product lines.
If revenue is zero or negative, the calculator will not divide by zero and will show an error. If COGS is zero, gross margin is 100% and markup is undefined (shown as 0), because you cannot express a profit as a multiple of a cost that does not exist.
The Gross Margin Formula
Gross margin uses two inputs that every small business already tracks:
Gross Profit = Revenue − COGS
Gross Margin % = (Gross Profit ÷ Revenue) × 100
Markup % = (Gross Profit ÷ COGS) × 100
Worked example on $500,000 of revenue with $300,000 of COGS:
- Gross profit = $500,000 − $300,000 = $200,000
- Gross margin = $200,000 ÷ $500,000 = 40%
- Markup = $200,000 ÷ $300,000 = 66.7%
Notice that 40% margin and 66.7% markup describe the same $200,000 profit — the only difference is the denominator. Margin is profit divided by what you sold it for; markup is profit divided by what it cost you. If you remember that markup is always larger than margin for the same dollar profit, you will never confuse the two again.
Margin vs. Markup: Why They Are Different
Many founders set prices by taking their cost and "marking it up 50%" — but they then report a "margin" that is mathematically wrong. The table below shows what actually happens at common markups:
- 25% markup on a $100 product → price $125, margin = $25 ÷ $125 = 20%.
- 50% markup on a $100 product → price $150, margin = $50 ÷ $150 = 33.3%.
- 100% markup on a $100 product → price $200, margin = $100 ÷ $200 = 50%.
The conversion is not one-to-one. To go from a target margin to the required markup, divide the desired profit by the cost: a 40% margin on a product that costs $60 means a price of $100 (markup 66.7%), not a price of $84 (which would be a 40% markup but only a 28.6% margin).
Examples
Example 1 — A product business at steady state. A maker sells $500,000 of hand-thrown pottery in a year. Clay, glaze, kiln labor, and the potter's direct wages total $300,000. Gross profit is $200,000, gross margin is 40%, and markup on cost is 66.7%. The 40% margin means the business has 40 cents of every sales dollar left to pay studio rent, the website, advertising, and the owner's own draw.
Example 2 — A break-even product. A reseller moves $100,000 of inventory at exactly $100,000 landed cost. Gross profit is $0, gross margin is 0%, and markup is 0%. Every dollar of revenue is consumed by the goods themselves, leaving nothing for operating expenses — a warning sign that pricing or sourcing needs work.
Example 3 — A seven-figure manufacturer. A factory rings up $2,000,000 in annual revenue with direct materials and production labor of $1,200,000. Gross profit is $800,000, gross margin is 40%, and markup is 66.7%. Running the same calculator at this scale confirms the engine handles large numbers cleanly — and shows that a 40% margin at $2M revenue produces twice the gross profit dollars of a 40% margin at $500k, even though the percentage is identical.
Example 4 — Negative revenue guard. Entering a negative revenue number (for example, −$500,000) triggers an error rather than a nonsense margin. The engine treats revenue as a positive quantity; returns and allowances should already be netted out of the revenue field before you type it in.
Example 5 — Per-unit pricing. Take the same $500,000 revenue and $300,000 COGS but enter 1,000 units sold. The overall margin stays at 40% and markup at 66.7%, but the per-unit figures reveal the unit economics: revenue of $500 per unit, COGS of $300 per unit, and gross profit of $200 per unit. That $200 is the room you have to spend on marketing, shipping, and platform fees per sale before you break even on contribution margin.
FAQ
What is a good gross margin?
It depends entirely on the industry. Software companies run at 70–85% gross margins because delivering another copy costs almost nothing. Grocery stores run at 20–30% because food is cheap and perishable. Restaurants typically land at 60–70% before labor. A "good" margin is one that comfortably covers operating expenses and leaves a net profit — compare yourself to publicly traded competitors in your sector, not to an arbitrary benchmark.
What is the difference between gross margin and net margin?
Gross margin only subtracts COGS from revenue. Net margin subtracts all expenses — operating costs, interest, taxes, and overhead — from revenue. A business can have a healthy 45% gross margin and still lose money at the net line if rent, payroll, and marketing are too high. This calculator is gross-only; use a net margin calculator for the bottom-line ratio.
Is markup the same as gross margin?
No. Markup is profit divided by cost; margin is profit divided by revenue. They describe the same profit dollar but with different denominators, and markup is always the larger number. A 40% margin corresponds to a 66.7% markup, and a 50% markup corresponds to only a 33.3% margin. The calculator shows both so you can convert between them without algebra.
What counts as COGS?
COGS includes the direct costs of producing the goods you sold during the period: raw materials, components, direct factory labor, factory utilities and rent, equipment depreciation tied to production, and freight in. It excludes sales commissions, marketing, office rent, executive salaries, software subscriptions, and R&D — those are operating expenses below the gross profit line. When in doubt, match the definition your accountant uses on Schedule C or your income statement.
How do I increase my gross margin?
Three levers: raise prices (if demand allows), lower direct costs by negotiating with suppliers or switching materials, and shift the product mix toward higher-margin SKUs. Cutting operating expenses does not move gross margin at all — gross margin is strictly about the relationship between revenue and the direct cost of the goods sold.
Why is my gross margin negative?
A negative gross margin means COGS is larger than revenue — you are selling products for less than it costs to make them. This happens when a supplier price hike has not been passed through, when clearance discounts are too deep, or when product mix has shifted toward low-margin items. Fix the pricing or sourcing immediately, because every additional sale is losing you money.
Disclaimer
This gross margin calculator is provided for informational purposes only and does not constitute accounting, tax, legal, or financial advice. Gross profit, margin, and markup are estimates based solely on the revenue and COGS figures you enter; actual financial statements require consistent accounting treatment of inventory, returns, depreciation, and other line items. Always consult a qualified accountant or financial professional before making pricing, investment, or borrowing decisions.