Gross margin and markup answer related but different pricing questions. This guide explains both formulas, shows how to use a gross margin calculator or markup calculator, and provides repeatable examples for products and services so you can set prices with clearer assumptions.
Overview
Gross margin measures the share of revenue left after direct costs. Markup measures how much you add to cost to arrive at a selling price. The distinction matters because the same percentage does not produce the same result.
For example, a 25% markup produces a 20% gross margin, while a 25% gross margin requires a 33.33% markup. Confusing the two can leave a business below its intended profit target, particularly when discounts, payment fees, fulfillment costs, or other variable expenses reduce the amount retained from each sale.
Gross margin formula
Gross margin (%) = (Selling price − Direct cost) ÷ Selling price × 100
Gross profit is the selling price minus the direct cost of delivering the product or service. Gross margin expresses that profit as a percentage of revenue.
Markup formula
Markup (%) = (Selling price − Direct cost) ÷ Direct cost × 100
Markup expresses profit as a percentage of cost. It is often convenient for building a price from a known cost, while margin is usually more useful for reviewing profitability and comparing actual results with a target.
| Measure | Formula | Primary question |
|---|---|---|
| Gross profit | Price − direct cost | How much remains before other operating expenses? |
| Gross margin | Gross profit ÷ price | What percentage of revenue remains? |
| Markup | Gross profit ÷ direct cost | How much was added to cost? |
How to estimate
A reliable pricing calculator starts with a clearly defined unit. That might be one physical product, one project, one subscription period, one service hour, or one completed deliverable. Then follow these steps.
- List the direct cost per unit. Include costs that increase when you sell or deliver one more unit. For a product, this may include materials, purchase cost, packaging, and per-order fulfillment. For a service, it may include delivery labor or contractor time directly assigned to the work.
- Choose a pricing basis. Decide whether you are starting from a desired markup, a desired gross margin, or a market price that needs to be tested. Do not use a markup formula when your target is actually a margin percentage.
- Calculate the price. For a target markup, use Price = Direct cost × (1 + markup). For a target gross margin, use Price = Direct cost ÷ (1 − target margin). Express percentages as decimals in the calculation: 30% becomes 0.30.
- Check deductions from the sale. Payment processing, marketplace fees, commissions, shipping subsidies, refunds, and planned discounts may reduce the amount received. Add these to the model rather than assuming the list price equals net revenue.
- Test the result against the business model. Gross margin is not the same as final net profit. Review whether the expected gross profit can contribute toward overhead such as software, payroll, rent, insurance, administration, and sales activity.
For a target margin, the denominator is especially important. If the target is a 40% gross margin and the direct cost is $60, the price is $60 ÷ (1 − 0.40), or $100. A 40% markup would instead produce a price of $84 and a gross margin of approximately 28.6%.
Inputs and assumptions
The quality of a gross margin calculator depends on the inputs. Keep the following categories separate so the result remains easy to audit.
Direct costs
Use costs directly associated with producing or delivering the sale. For inventory, consider the purchase cost, materials, packaging, and per-unit fulfillment. For professional services, estimate delivery time realistically and assign a cost to that time. If the owner performs the work, include a reasonable internal labor cost rather than treating the labor as free.
Variable selling costs
Fees that occur only, or mainly, when a sale is made should be visible in the model. Examples include payment fees, sales commissions, marketplace charges, transaction-based software costs, and shipping paid by the business. You can either include these in the direct-cost figure or show them as a separate deduction, but apply the same method consistently.
Overhead and capacity
Overhead does not always belong in gross margin, but it still affects pricing decisions. A service with a strong gross margin may remain unprofitable if billable capacity is low or fixed costs are high. For hourly work, account for non-billable time such as administration, sales, support, training, and leave when converting a desired annual income into a rate.
Taxes, discounts, and payment terms
Separate sales taxes or similar pass-through amounts from business revenue where appropriate for your accounting setup. Do not count a temporary promotional price as the standard price without checking its effect on margin. Also consider delayed payment, refunds, bad debt, and currency conversion when they are material to the offer.
A cloud spreadsheet or accounting system can make this process repeatable. Keep columns for list price, actual selling price, direct cost, variable fees, discount, gross profit, gross margin, and markup. This creates a useful audit trail when assumptions change.
Worked examples
Product example: target margin versus target markup
Assume a product has a direct cost of $48 per unit. You want to compare a 30% markup with a 30% gross margin.
- 30% markup: $48 × 1.30 = $62.40 selling price.
- Gross profit: $62.40 − $48 = $14.40.
- Gross margin: $14.40 ÷ $62.40 = approximately 23.1%.
- 30% gross margin: $48 ÷ (1 − 0.30) = approximately $68.57 selling price.
- Gross profit at that price: $68.57 − $48 = approximately $20.57.
The two methods produce different prices. If the business needs a 30% margin, applying a 30% markup is not sufficient.
Service example: pricing delivery time
Assume a technical consultant estimates 12 hours of direct delivery work at an internal cost of $35 per hour. The direct delivery cost is therefore $420. The consultant wants a 50% gross margin before considering overhead and taxes.
Using the target-margin formula: $420 ÷ (1 − 0.50) = $840. The project price is $840, equivalent to $70 per delivery hour. If the project also requires four hours of unpaid administration and coordination, the effective rate across all 16 hours is $52.50 per hour. That second figure is useful for capacity and income planning, even though the gross-margin calculation is based on the direct delivery cost defined in the model.
For a more complete review, add expected payment fees and discounts. If a 10% discount is likely, calculate margin on the discounted revenue, not only on the advertised list price.
When to recalculate
Pricing is an estimate built from changing inputs, so revisit the calculation whenever a key assumption moves. Recalculate when supplier costs, wages, contractor rates, shipping, payment fees, software charges, exchange rates, or fulfillment arrangements change. Review it before launching a new product, service package, subscription, or discount campaign.
Set a regular review rhythm as well. A monthly or quarterly check can compare actual unit costs and realized selling prices with the assumptions in your calculator. This is particularly useful when sales mix changes: a higher proportion of discounted orders, support-heavy customers, or lower-margin products can reduce overall results even when individual list prices remain unchanged.
Before approving a price, use this short checklist:
- Confirm the unit and the period being measured.
- Separate direct costs, variable selling costs, and overhead.
- State whether the target is markup or gross margin.
- Test the actual discounted price, not only the list price.
- Check fees, taxes, refunds, and payment terms.
- Compare the result with capacity, cash-flow needs, and break-even requirements.
- Record the assumptions and schedule the next review.
Use a gross margin calculator to evaluate profitability and a markup calculator to build a price from cost. Keeping both measures visible gives you a clearer pricing review and makes it easier to respond when costs or market conditions change. For related planning, pair the calculation with a small business cash flow forecast and, for software decisions, a SaaS ROI and break-even analysis.