Skip to content
SPCXTools

Margin Calculator

Calculate selling price, profit margin, or markup based on your item cost.

Runs locally — files never leave your device

Loading tool…

How to use Margin Calculator

  1. 1Enter the cost of producing or purchasing your item.
  2. 2Choose what you want to base your calculation on: a target selling price, a desired gross margin, or a target markup.
  3. 3Enter the value for your selected option (e.g., a 20% margin).
  4. 4The calculator instantly displays the selling price, total profit, margin percentage, and markup percentage.

A fast, private margin calculator

Setting the right price for your products or services is critical to running a profitable business. This margin calculator helps you instantly figure out your selling price, total profit, gross margin, and markup based on your costs. Whether you are pricing a new retail product, quoting a wholesale order, or estimating service profitability, you can see all your key financial metrics update in real time as you type.

Because this tool runs entirely locally in your web browser, your financial data is completely private. Your product costs and pricing strategies are never uploaded to a server or stored anywhere, making it safe to use for confidential business planning.

Margin vs. Markup: Understanding the difference

The most common pricing mistake business owners make is confusing margin with markup. While both measure profitability, they look at the numbers from two different angles. Mixing them up can lead to underpricing your products and losing money.

Gross Margin is the percentage of the selling price that is profit. It tells you how much out of every dollar of sales you get to keep after paying for the item. Formula: (Profit / Selling Price) × 100

Markup is the percentage by which the cost is increased to arrive at the selling price. It tells you how much you are adding to your base cost. Formula: (Profit / Cost) × 100

For example, if you buy a product for $60 and sell it for $100:

  • Your profit is $40.
  • Your margin is 40% ($40 profit / $100 selling price).
  • Your markup is 66.67% ($40 profit / $60 cost).

If you want to achieve a 40% profit margin, you cannot simply add 40% to your cost (which would only give you a selling price of $84 and a 28.5% margin). You must use the correct formula, which this gross margin calculator handles automatically.

How to use this profit margin calculator

This tool is designed to be flexible depending on what numbers you already have in mind. You always start by entering your base Cost. Then, select what you want to base your calculation on:

  • I know the Selling Price: Use this mode if you have a target price in mind (or if you are analyzing a competitor's price) and want to see what the resulting profit, margin, and markup will be.
  • I know the Gross Margin: Use this mode as a selling price calculator. Enter your target profit margin percentage, and the tool will calculate exactly what you need to charge to hit that goal.
  • I know the Markup: Use this mode if your business applies a standard markup rate to all costs. Enter the markup percentage to find your final price and see what your actual gross margin will be.

As you switch between these three modes, the calculator smartly carries over your current results. This allows you to enter a target price, see that it results in a 32% margin, switch to "Gross Margin" mode, and bump it up to 35% to see the new required selling price.

Common use cases for pricing tools

E-commerce and Retail Pricing. Retailers often have strict gross margin targets to ensure they have enough profit left over to cover marketing, shipping, and overhead. Using a markup calculator ensures you don't accidentally underprice items when applying standard wholesale markups.

Wholesale and B2B Sales. If you manufacture goods, you might sell directly to consumers at one price and to wholesalers at another. You can use this calculator to quickly figure out a wholesale price that still leaves you with an acceptable baseline margin.

Service and Agency Quoting. Service businesses can use this tool by entering the hourly cost of their labor and materials as the "Cost." By targeting a specific gross margin, agencies can ensure their project quotes remain profitable even if timelines stretch.

Related financial calculators

Pricing a product is often just the first step in retail math. If you are planning a sale, you can use the Discount Calculator to see how a percentage off will affect your final price. To calculate the final cost to the consumer including local taxes, try the Sales Tax Calculator. If you need to figure out the general percentage difference between two numbers, the Percentage Calculator is a handy all-purpose tool.

Frequently asked questions

What is the difference between margin and markup?
Margin (or gross margin) is the profit expressed as a percentage of the selling price. Markup is the profit expressed as a percentage of the cost. For example, if an item costs $50 and sells for $100, the profit is $50. The margin is 50% ($50 / $100), while the markup is 100% ($50 / $50).
How do I calculate the selling price from a desired margin?
To find the selling price based on a target gross margin, divide the cost by 1 minus the margin percentage (expressed as a decimal). For example, for a 20% margin on a $40 cost: $40 / (1 - 0.20) = $50. This profit margin calculator does this math for you automatically.
Why can't my margin be 100% or higher?
Because margin is profit divided by the selling price, a 100% margin would mean the cost is zero. If you have any cost at all, the margin must always be less than 100%. If you want to double your money, you are looking for a 100% markup, which equals a 50% margin.
Is my financial data kept private?
Yes. This margin calculator runs entirely in your browser using JavaScript. No numbers, costs, or pricing data are sent to any server, ensuring your business financials remain completely private.
What happens when I switch between Price, Margin, and Markup?
When you switch your known variable, the calculator automatically carries over the current result to the new input field. This makes it easy to see how a specific price translates into a margin, and then tweak that margin to see the new resulting price.