A profit margin calculator helps you see what remains after the costs of selling a product or service. This guide explains gross, net, and contribution margin; shows how markup differs from margin; and provides spreadsheet-ready formulas you can reuse whenever prices, costs, discounts, fees, or refunds change.
Overview
Profit margin answers a practical question: how much of your revenue becomes profit after selected costs are deducted? It is usually expressed as a percentage, which makes it easier to compare products, services, subscriptions, or periods with different sales volumes.
The most useful calculation depends on the decision you are making:
- Gross margin shows what remains after the direct cost of delivering or producing what you sell.
- Contribution margin shows what remains after variable costs and helps with pricing, sales mix, and break-even decisions.
- Net profit margin shows what remains after operating expenses and other costs included in your profit calculation.
- Markup measures profit as a percentage of cost, rather than as a percentage of revenue.
These measures should not be treated as interchangeable. A business can have a 50% markup but a 33.3% margin, because the two calculations use different denominators. For a wider view of the sales volume required to cover fixed and variable costs, use the break-even calculator guide.
How to estimate profit margin
Start with a consistent revenue figure. For a product, this may be the selling price after discounts. For a service, it may be the amount invoiced for a project. For a subscription, it may be the recurring amount recognized for the period being reviewed. Decide whether refunds, credits, payment fees, and taxes are included before you calculate.
Gross margin formula
Gross profit = Revenue − Cost of goods sold (COGS)
Gross margin = (Gross profit ÷ Revenue) × 100
COGS should represent costs directly associated with producing or delivering the sale. Examples may include materials, purchased inventory, direct production labor, transaction-specific fulfillment, or third-party delivery costs. The exact classification depends on your bookkeeping method, so use the same definition each time you compare periods.
Contribution margin formula
Contribution profit = Revenue − Variable costs
Contribution margin = (Contribution profit ÷ Revenue) × 100
Variable costs rise or fall with sales activity. They can include payment processing, sales commissions, packaging, usage-based software, or contractor costs tied to a particular project. Contribution margin is useful when deciding whether an additional sale, customer, or service package contributes enough toward fixed expenses.
Net profit margin formula
Net profit = Revenue − Total expenses
Net profit margin = (Net profit ÷ Revenue) × 100
Total expenses may include COGS, payroll, rent, software, insurance, marketing, professional fees, interest, and other expenses you choose to include. Be precise about whether the result is operating profit, profit before tax, or profit after tax. Calling every result “net profit” can make comparisons misleading.
Markup versus margin
Markup = (Selling price − Cost) ÷ Cost × 100
Margin = (Selling price − Cost) ÷ Selling price × 100
If an item costs 60 and sells for 90, the profit is 30. The markup is 50% because 30 is half of the 60 cost. The margin is 33.3% because 30 is one-third of the 90 selling price. Use markup when building a price from a known cost; use margin when evaluating revenue performance.
Inputs and assumptions for a reliable calculator
A calculator is only as useful as its inputs. Create one row for each product, service, or subscription and record the assumptions behind every number.
| Spreadsheet input | What to enter | Why it matters |
|---|---|---|
| List price | Standard selling price | Provides the starting price before adjustments |
| Discounts | Promotions, negotiated reductions, or credits | Prevents margin from being calculated on an amount you do not collect |
| Refunds and returns | Expected or recorded reversals | Brings realized revenue closer to actual results |
| Net revenue | Price minus discounts, refunds, and applicable adjustments | Use this as the denominator for most margin calculations |
| Direct costs | Costs directly tied to delivery or production | Supports gross margin |
| Variable selling costs | Fees, commissions, usage costs, or delivery charges | Supports contribution margin |
| Fixed and operating expenses | Costs incurred to run the business or period | Supports net profit margin |
For spreadsheet formulas, use cells such as:
Net Revenue = List Price - Discounts - RefundsGross Profit = Net Revenue - Direct CostsGross Margin = Gross Profit / Net RevenueContribution Profit = Net Revenue - Direct Costs - Variable Selling CostsContribution Margin = Contribution Profit / Net RevenueNet Profit = Net Revenue - Direct Costs - Variable Selling Costs - Operating ExpensesNet Profit Margin = Net Profit / Net Revenue
Format the result cells as percentages and protect against a zero-revenue division. If sales tax or VAT is collected on behalf of a tax authority, businesses commonly exclude it from revenue for margin analysis, but your accounting treatment should follow your records and applicable rules. Do not mix tax-inclusive prices with tax-exclusive costs without documenting the difference.
Worked examples
Example 1: physical product
Assume a product has a list price of 90, a discount of 5, direct production and fulfillment costs of 45, payment fees of 3, and allocated operating expense of 12. Net revenue is 85. Gross profit is 40, producing a gross margin of 47.1%. After the payment fee, contribution profit is 37 and contribution margin is 43.5%. After the operating expense, net profit is 25 and net profit margin is 29.4%.
The example shows why a gross margin review alone may miss the effect of payment fees, discounts, and overhead. If the product is frequently sold at the discounted price, use the discounted amount as the normal revenue assumption rather than treating the discount as an unusual exception.
Example 2: fixed-price service
Suppose a project is invoiced at 1,200. Direct contractor time and project-specific tools cost 480, and payment fees cost 36. Gross profit is 720, so gross margin is 60%. Contribution profit is 684, giving a contribution margin of 57%. If 240 of general operating expense is allocated to the project, the resulting net profit is 444 and net profit margin is 37%.
For services, track the hours behind the direct cost. A project can appear profitable in total while producing an unattractive return on the operator’s time if the work takes longer than planned. Pair the margin calculation with an effective hourly rate or a project pricing calculator.
Example 3: subscription service
Assume one monthly subscription produces 50 of net revenue. Variable delivery costs are 8, including usage-based tools and support time, while allocated operating expenses are 20. Contribution profit is 42, or an 84% contribution margin. After allocated operating expenses, net profit is 22 and net profit margin is 44%.
Subscription analysis should also consider cancellations, refunds, discounts, and changes in usage. Review the same customer cohort or billing period consistently; otherwise, one-time annual payments or promotional pricing can distort the comparison.
When to recalculate
Recalculate margins at a regular monthly or quarterly review, and whenever an important input changes. A recurring review catches gradual margin erosion that may not be obvious in total revenue.
- Update product costs when suppliers, materials, shipping, or fulfillment terms change.
- Review service margins when delivery time, contractor rates, or project scope changes.
- Recalculate after changing list prices, discount rules, bundles, or subscription tiers.
- Include new payment processing, marketplace, software, or usage-based fees.
- Separate refunds, credits, and returns from ordinary sales so realized revenue is visible.
- Revisit expense allocations when hiring, workspace, payroll, or operating systems change.
- Compare planned margins with actual results after the period closes.
Use a simple review workflow: copy the prior period’s calculator, replace assumptions with actual figures, flag any margin change, and investigate the largest movement first. If contribution margin is falling, examine price and variable costs. If gross margin is stable but net margin is falling, inspect overhead and operating expenses. For related operational improvements, the small business operations template pack can help organize pricing and invoice records, while the workflow automation audit can help identify repetitive work that is increasing delivery costs.
A profit margin calculator is most valuable when it becomes a repeatable habit rather than a one-time pricing exercise. Keep definitions consistent, record the assumptions beside each result, and update the calculation whenever your prices, costs, fees, or sales mix change.