Running a profitable business requires precise knowledge of your numbers. Use our free Profit Margin Calculator below to instantly determine your gross profit, profit margin percentage, and markup percentage. Whether you are pricing a new product or analyzing existing sales, this tool helps you ensure you are making money on every sale.
Calculate Your Margin
Please enter valid positive numbers for both Cost and Price.
Gross Profit:$0.00
Gross Margin:0.00%
Markup:0.00%
function calculateProfitMargin() {
// Get input values
var costInput = document.getElementById('pm_cost').value;
var priceInput = document.getElementById('pm_revenue').value;
var errorMsg = document.getElementById('pm_error');
var resultsDiv = document.getElementById('pm_results');
// Parse values
var cost = parseFloat(costInput);
var price = parseFloat(priceInput);
// Validation
if (isNaN(cost) || isNaN(price) || cost < 0 || price 0) {
grossMargin = (grossProfit / price) * 100;
}
// Markup = (Gross Profit / Cost) * 100
// Handle division by zero if cost is 0
var markup = 0;
if (cost > 0) {
markup = (grossProfit / cost) * 100;
}
// Update DOM
document.getElementById('res_profit').innerHTML = '$' + grossProfit.toFixed(2);
document.getElementById('res_margin').innerHTML = grossMargin.toFixed(2) + '%';
document.getElementById('res_markup').innerHTML = markup.toFixed(2) + '%';
// Show results
resultsDiv.style.display = 'block';
}
What is Profit Margin?
Profit margin is one of the most widely used financial ratios in business. It measures the degree to which your company or a specific business activity makes money, essentially representing the percentage of sales that has turned into profit.
While there are several types of profit margins (gross, operating, and net), this calculator focuses on Gross Profit Margin, which looks specifically at the relationship between the cost of the item and the price you sell it for.
Profit Margin Formula
To calculate the gross profit margin manually, you first need to determine your Gross Profit. This is done by subtracting the Cost of Goods Sold (COGS) from your Revenue (Selling Price).
Gross Profit = Revenue – Cost of Goods Sold
Once you have the gross profit, you divide it by the revenue and multiply by 100 to get the percentage:
Gross Margin (%) = (Gross Profit / Revenue) × 100
Calculation Example
Let's say you buy a t-shirt for $10 (Cost) and sell it for $20 (Revenue).
Gross Profit: $20 – $10 = $10
Gross Margin: ($10 / $20) × 100 = 50%
The Difference Between Margin and Markup
Many business owners confuse margin and markup, but they are very different metrics, even though they use the same inputs. Mixing them up can lead to pricing errors and lost revenue.
Profit Margin is profit divided by Revenue. It tells you how much of the sales price is profit. It can never exceed 100%.
Markup is profit divided by Cost. It tells you how much you added to the cost price to get the selling price. Markup can be (and often is) higher than 100%.
Markup (%) = (Gross Profit / Cost) × 100
Using the previous t-shirt example:
Margin: ($10 profit / $20 price) = 50%
Markup: ($10 profit / $10 cost) = 100%
If you want a 50% profit margin, you cannot simply mark up your product by 50%. You must calculate the price based on the desired margin formula.
Why Monitoring Profit Margin is Critical
Tracking your margin ensures your business remains healthy. If your margins are too low, you may not be covering your operating expenses (rent, utilities, salaries), leading to a net loss. Conversely, if your margins are significantly higher than the industry average, you might be pricing yourself out of the market. Regularly using a profit margin calculator helps you:
Set competitive yet profitable prices.
Identify products that are dragging down overall profitability.