Margin Calculator
Calculate profit margins from cost and selling price with precision. Understanding margins is essential for pricing strategies, profitability analysis, business planning, and comparing your performance against industry benchmarks. Whether you're a retailer, manufacturer, or service provider, profit margin calculations help ensure your business remains financially healthy.
Understanding Profit Margin
Profit margin expresses your profit as a percentage of the selling price (revenue). It answers the question: "For every dollar I earn, how much is actual profit?" This metric is crucial for investors, lenders, and business owners because it reveals operational efficiency and pricing power.
Types of Profit Margins
| Type | Formula | What It Measures |
|---|---|---|
| Gross Margin | ((Revenue - COGS) / Revenue) × 100 | Production efficiency |
| Operating Margin | (Operating Income / Revenue) × 100 | Operational efficiency |
| Net Margin | (Net Profit / Revenue) × 100 | Overall profitability |
| Contribution Margin | ((Price - Variable Costs) / Price) × 100 | Per-unit profitability |
Margin vs Markup: Critical Distinction
Many people confuse margin and markup—they're related but different calculations:
| Metric | Base | Formula | Business Use |
|---|---|---|---|
| Margin | Selling Price | Profit ÷ Price × 100 | Financial reporting |
| Markup | Cost | Profit ÷ Cost × 100 | Pricing decisions |
Margin and Markup Comparison
| Cost | Selling Price | Profit | Margin | Markup |
|---|---|---|---|---|
| $50 | $100 | $50 | 50% | 100% |
| $60 | $100 | $40 | 40% | 67% |
| $70 | $100 | $30 | 30% | 43% |
| $75 | $100 | $25 | 25% | 33% |
| $80 | $100 | $20 | 20% | 25% |
| $90 | $100 | $10 | 10% | 11% |
Industry Average Margins
| Industry | Gross Margin | Net Margin | Notes |
|---|---|---|---|
| Software/SaaS | 70-90% | 15-25% | High margins, scalable |
| Retail (clothing) | 40-60% | 4-10% | Inventory risk |
| Grocery | 25-35% | 2-3% | High volume, thin margins |
| Restaurants | 60-70% | 3-9% | Labor intensive |
| Manufacturing | 25-40% | 5-10% | Capital intensive |
| Consulting | 50-80% | 15-30% | Service-based |
| E-commerce | 40-60% | 5-12% | Varies by category |
Calculating Target Selling Price
To achieve a specific margin, use: Selling Price = Cost ÷ (1 - Target Margin %)
| Cost | Target Margin | Calculation | Selling Price |
|---|---|---|---|
| $50 | 30% | $50 ÷ 0.70 | $71.43 |
| $50 | 40% | $50 ÷ 0.60 | $83.33 |
| $50 | 50% | $50 ÷ 0.50 | $100.00 |
| $100 | 25% | $100 ÷ 0.75 | $133.33 |
Implementation
``javascript
function calculateMargin(cost, sellingPrice) {
const profit = sellingPrice - cost;
const margin = (profit / sellingPrice) * 100;
const markup = (profit / cost) * 100;
return {
cost: cost.toFixed(2),
sellingPrice: sellingPrice.toFixed(2),
profit: profit.toFixed(2),
marginPercent: margin.toFixed(2) + '%',
markupPercent: markup.toFixed(2) + '%'
};
}
function priceForTargetMargin(cost, targetMarginPercent) {
const sellingPrice = cost / (1 - targetMarginPercent / 100);
return sellingPrice.toFixed(2);
}
console.log(calculateMargin(60, 100));
// { cost: '60.00', sellingPrice: '100.00', profit: '40.00',
// marginPercent: '40.00%', markupPercent: '66.67%' }
``
Improving Profit Margins
Increase margins by raising prices (if the market allows), reducing direct costs, negotiating better supplier terms, reducing waste, or shifting to higher-margin products. Even a 1-2% margin improvement can significantly impact profitability at scale.