A profit margin calculator helps you see what remains after costs, distinguish margin from markup, and test whether a price is commercially sustainable. Use the formulas and worked examples below to compare gross margin, net profit margin, and markup whenever your costs, discounts, or service rates change.
Overview
Profitability can look different depending on which costs you include. A product may have a healthy gross margin while the business still produces little net profit after payroll, software, rent, marketing, payment fees, and other operating expenses. A markup calculation answers a different question: how much has the selling price increased above the direct cost?
Use these three measures together:
- Gross profit margin shows the percentage of revenue left after direct costs, such as materials, inventory, production labor, or delivery costs directly tied to a sale.
- Net profit margin shows the percentage of revenue left after direct costs and operating expenses included in your calculation.
- Markup shows how much the selling price exceeds the cost, expressed as a percentage of cost rather than revenue.
These measures should not be treated as interchangeable. A 50% markup does not produce a 50% margin. If an item costs $100 and sells for $150, the markup is 50%, but the gross profit margin is $50 divided by $150, or 33.3%.
For a broader pricing decision, pair this analysis with a break-even point calculator. Margin tells you what each sale contributes; break-even analysis helps estimate how many sales are needed to cover fixed costs.
How to estimate
Start with a consistent period or transaction. You can calculate margins for one product, one project, one customer segment, or the whole business. For a business-level review, use figures from the same accounting period and make sure revenue and costs cover the same activities.
Gross profit margin formula
Gross profit = Revenue − Direct costs
Gross profit margin = Gross profit ÷ Revenue × 100
For example, if revenue is $20,000 and direct costs are $8,000, gross profit is $12,000. The gross profit margin is $12,000 ÷ $20,000 × 100, or 60%.
Net profit margin formula
Net profit = Revenue − Direct costs − Operating expenses
Net profit margin = Net profit ÷ Revenue × 100
If the same business has $9,000 in operating expenses, net profit is $3,000 and net profit margin is $3,000 ÷ $20,000 × 100, or 15%. The result depends on which expenses you include, so document the definition used.
Markup formula
Markup = (Selling price − Cost) ÷ Cost × 100
If the cost is $80 and the selling price is $120, the profit is $40. Markup is $40 ÷ $80 × 100, or 50%. The gross margin is $40 ÷ $120 × 100, or 33.3%.
Converting a target margin into a price
If you know your direct cost and want a target gross margin, use:
Selling price = Direct cost ÷ (1 − Target margin)
For a $60 direct cost and a target margin of 40%, the price is $60 ÷ 0.60, or $100. This is different from adding a 40% markup, which would produce a price of $84 and a margin of about 28.6%.
Inputs and assumptions
A calculator is only as useful as the inputs behind it. Before entering numbers, decide what each figure represents and whether it is recorded on a consistent basis.
- Revenue: Use the selling value of the work or goods being analyzed. Decide whether discounts, refunds, credits, sales taxes, or VAT are excluded from revenue for your internal calculation. Apply the same treatment each time.
- Direct costs: Include costs that rise directly with the sale. Examples include inventory, materials, transaction-specific subcontracting, production labor, packaging, shipping paid by the business, or usage-based software.
- Operating expenses: Include costs required to run the business but not assigned to one specific sale. These may include salaries, rent, general software, insurance, administration, marketing, and professional fees.
- Time period: Use a month, quarter, project, or order consistently. Avoid comparing a monthly revenue figure with annual expenses unless you have converted them to the same basis.
- Tax treatment: Keep business performance calculations separate from tax calculations unless your accounting process specifically requires otherwise. Tax rules and reporting treatments can differ by location and entity.
For service businesses, labor classification deserves particular care. A consultant may treat delivery time as a direct project cost, while an owner reviewing overall profitability may also want to account for non-billable sales, administration, and management time. Both views can be useful, but they answer different questions.
For recurring businesses, distinguish contracted revenue from collected cash. A margin calculation generally evaluates revenue and costs for the same period; it is not automatically a cash-flow analysis. If payment timing is a concern, review your invoicing and accounts payable processes alongside the margin result.
Worked examples
Agency project
An agency bills a project at $6,000. Delivery labor and project-specific contractor costs total $2,400. Gross profit is $3,600, producing a gross margin of 60%. If the agency allocates $1,800 of general operating expenses to the project review, net profit is $1,800 and net margin is 30%.
This comparison can reveal whether the quoted fee covers delivery effort but leaves too little for account management, sales, software, and leadership time. Before changing the price, check the assumed hours and whether scope changes are being recorded.
Consulting engagement
A consultant charges $3,000 for an engagement. Direct delivery costs, including an assistant and travel assigned to the engagement, total $600. Gross profit is $2,400 and gross margin is 80%. If the consultant spends additional unpaid time on proposals, scheduling, revisions, and administration, those activities may reduce the effective net margin.
A useful pricing review therefore compares the quoted fee with total estimated hours, not just billable hours. An service business pricing review checklist can help capture scope, discounts, delivery time, and revision risk.
Ecommerce product
An online store sells an item for $75. Inventory costs $30, packaging costs $3, and transaction and fulfillment costs assigned to the order total $7. Direct cost is $40, so gross profit is $35. The gross margin is 46.7%, while markup is 87.5% because $35 is 87.5% of the $40 cost.
If the store offers a 10% discount, the selling price falls to $67.50. Assuming direct costs remain $40, gross profit becomes $27.50 and gross margin falls to about 40.7%. This illustrates why discount decisions should be tested before they are published.
SaaS subscription
A software company receives $12,000 of subscription revenue for a period. Hosting, support tools tied to usage, and other directly attributable costs total $3,600. Gross profit is $8,400 and gross margin is 70%. After $6,000 of broader operating expenses, net profit is $2,400 and net margin is 20%.
The result can support decisions about plan pricing, customer usage limits, support coverage, and acquisition spending. Recalculate by customer segment when a small group of high-usage accounts creates materially different direct costs.
When to recalculate
Profitability is not a one-time number. Revisit the calculation whenever an input changes or when the previous assumptions no longer describe how work is delivered.
- Review product or service margins when supplier, contractor, payroll, hosting, shipping, or payment costs change.
- Recalculate after changing prices, package structure, minimum fees, retainers, subscription plans, or discount rules.
- Test every significant promotion using the discounted selling price rather than the standard list price.
- Review project margins after scope changes, additional revisions, rush work, or unplanned delivery time.
- Update the model when recurring software, rent, salaries, insurance, or other fixed expenses change.
- Compare actual results with the original estimate after a project, sales campaign, or accounting period closes.
Keep a simple pricing review worksheet with these columns: offer or product, selling price, discount, revenue after discount, direct costs, gross profit, gross margin, allocated operating expenses, net profit, net margin, and notes on assumptions. Add the date and version of each review so you can see why the result changed.
Finally, use the result to make one specific decision. You might adjust a price, remove an unprofitable option, set a minimum project fee, revise a discount, improve delivery efficiency, or investigate an unexpectedly high cost. Then save the updated assumptions and schedule the next review. A recurring finance review, supported by a weekly KPI scorecard such as this operations and finance KPI approach, makes the calculator a working management tool rather than a one-time estimate.