Use this margin calculator to find profit per item, margin percent, and markup percent, or to solve for the missing price or cost from the values you know. You can also add extra per-sale costs (like fees or shipping) to see your true per-item margin.
Advanced options
How to use our Margin Calculator
- Pick what you want to find in "Solve for" (Margin percent, Selling price, Cost, or Profit).
- Choose a currency for formatting (this does not change the math).
- Enter the inputs that stay visible for your Solve for choice (hidden fields are not used).
- Open "Advanced options" if you want to include extra per-sale costs, totals for a quantity, or a target total profit.
- If you set "Add extra per-sale costs?" to Yes, enter "Extra costs per item" (do not leave it blank).
- If you want totals, enter "Number of items" as a positive whole number (like 1, 10, 250).
- If you want a target profit goal, enter "Target total profit" and make sure quantity is greater than 0.
- Click "Calculate" to see profit per item, margin percent, markup percent, and any totals that apply.
- Read "Notes or warnings" if something is impossible (example: target margin of 100% with a nonzero cost) or undefined (example: price equals 0).
Definitions
Selling price (price): The money the customer pays for one item (revenue per item).
Cost per item (cost): What it costs you to make or buy one item.
Extra per-sale costs: Optional per-item costs you also pay (like payment processing fees, packaging, or shipping you cover). These are added to cost to form total cost.
Total cost per item (total cost): Cost per item plus extra per-sale costs (if enabled).
Profit per item (profit): Selling price minus total cost per item. Negative profit means a loss.
Margin percent (margin): Profit divided by selling price, as a percent. This is often called gross profit margin percent when cost means COGS (direct costs). [1]
Markup percent (markup): Profit divided by total cost, as a percent. Markup and margin are different.
Net profit margin: A different metric that uses net profit (after all expenses), not just per-item cost. [2]
Revenue and expenses: Revenue is money earned from selling; expenses are costs to run the business.
Methodology
What the calculator is doing
This calculator is a per-item (gross-style) margin tool: it compares selling price to per-item costs. If you also have per-sale fees or shipping you pay, turn them on so your total cost per item is more realistic. For full-business profitability, people often use net profit margin, which includes more expenses than per-item cost. [2]
Step 1: Build total cost per item
total_cost = cost + (extra_costs_enabled ? extra_costs : 0)
Step 2: Core relationships (profit, margin, markup)
profit = price - total_cost
margin_pct = 100 * profit / price
markup_pct = 100 * profit / total_cost
Margin is based on selling price (profit per dollar of price). Markup is based on cost (profit per dollar of cost). This is why markup is usually larger than margin when price is greater than cost. [1]
Step 3: Solve for the missing value (based on "Solve for")
If you solve for selling price using a target margin:
price = total_cost / (1 - margin_pct/100)
If you solve for total cost using a target margin:
total_cost = price * (1 - margin_pct/100)
If extra costs are enabled and you need the base cost (cost per item) from total cost:
base_cost = total_cost - extra_costs
If you solve for selling price using profit:
price = total_cost + profit
Step 4: Quantity totals (only when quantity is provided)
revenue_total = price * quantity
cost_total = total_cost * quantity
profit_total = profit * quantity
Step 5: Price needed for a target total profit (optional)
price_needed = total_cost + (target_profit_total / quantity)
Validation and edge cases (how errors and N/A happen)
Margin percent input: If a mode needs margin percent, it must be filled in (blank is an error, not 0).
Margin of 100% or more: If total cost is greater than 0 and margin percent is 100 or higher, solving for price is impossible because the formula divides by (1 - margin/100), which would be 0 or negative. In that case the calculator shows an error or N/A for the price.
Price equals 0: Margin percent is undefined when price is 0 (division by zero). The calculator blocks margin calculations until price is not 0.
Total cost equals 0: Markup percent is undefined when total cost is 0 and profit is not 0 (division by zero). If total cost is 0 and profit is 0, markup is shown as 0% with a note.
Negative profit and negative margin: Allowed. It means you are selling below your total cost (a loss).
Extra costs enabled: Extra costs becomes required so you do not accidentally forget it.
Quantity: If provided, it must be a positive whole number to keep totals clear.