February 2, 2026

How to calculate profit margin: Formulas and examples

Explore this topicOpen ChatGPT

Profit margin shows how much of your revenue you keep as profit after covering costs. Calculating profit margin helps you understand pricing, cost control, and overall business performance. Once you know your margin, you can compare results across time, benchmark against peers, and spot where profitability is slipping.

What is profit margin?

Profit margin is the percentage of your revenue that remains after subtracting costs. It shows how efficiently you turn sales into profit and is a core metric for pricing, planning, and performance tracking.

Businesses track profit margins so they can:

  • Compare performance over time
  • Benchmark against competitors
  • Identify where cost control or pricing improvements are needed

Profit margin isn’t the same as markup. Markup focuses on how much you add to cost to set a price, not how much revenue you keep as profit:

  • Profit margin: How much of each $1 in revenue becomes profit
  • Markup: How much you add on top of cost to set your price

For example, if a product costs you $60 to produce and you sell it for $100, your markup is:

Markup = (Selling price – Cost) / Cost * 100

Markup = ($100 – $60) / $60 * 100 = 66.7%

Your profit margin, however, is $40 / $100 = 40%. Markup appears larger because it’s based on cost, while margin is based on revenue. Confusing the two can lead to pricing mistakes.

Types of profit margins

There are three main types of profit margin: gross, operating, and net. Each highlights a different layer of profitability and answers a different business question.

Gross profit margin

Gross profit margin measures how much of your revenue remains after subtracting the cost of goods sold (COGS), such as materials and direct labor. It shows how efficiently you produce or deliver your product or service.

Use gross profit margin to evaluate pricing, sourcing, and production efficiency before accounting for overhead or administrative costs.

Across industries, gross margins vary widely. Software and professional services often post higher gross margins than retail or construction because their direct costs are lower. Benchmarks suggest gross margins often fall between 25% and 45% across many sectors.

Operating profit margin

Operating profit margin goes a step further by subtracting operating expenses, such as salaries, rent, and marketing, from gross profit. It reflects how well you manage day-to-day business costs.

Compared with gross margin, operating margin includes a greater share of fixed and variable expenses. Service-based businesses often report stronger operating margins, while capital-intensive industries like manufacturing and logistics tend to operate with tighter margins due to higher overhead.

Net profit margin

Net profit margin is the bottom-line profitability metric. It shows what you keep after all expenses, including COGS, operating costs, interest, and taxes.

Expenses that affect net profit margin include:

  • Cost of goods sold
  • Operating expenses
  • Interest
  • Taxes
  • One-time charges

These costs all reduce the profit you ultimately retain. Net profit margins vary by industry, but many healthy businesses target around 10% as a baseline and 20% or more as strong performance.

Profit margin formulas

Each profit margin uses the same basic structure but applies it at a different cost level. The steps below apply to gross, operating, and net profit margin calculations.

How to calculate profit margin (quick steps)

  1. Calculate revenue for the period
  2. Subtract costs to find profit (gross, operating, or net)
  3. Divide profit by revenue
  4. Multiply the result by 100 to get a percentage

Profit margin (%) = Profit / Revenue * 100

Gross profit margin formula

Gross profit margin focuses on the relationship between revenue and direct production costs. It isolates pricing and production efficiency without factoring in overhead or financing decisions.

Gross profit margin = (Revenue – COGS) / Revenue * 100

Example:

  • Revenue = $500,000
  • COGS = $300,000

Gross profit margin = ($500,000 – $300,000) / $500,000 * 100

Gross profit margin = $200,000 / $500,000 * 100 = 40%

A healthy gross margin suggests your core product or service is fundamentally profitable before indirect costs are applied.

Operating profit margin formula

Operating profit margin builds on gross margin by accounting for operating expenses such as payroll, rent, software, and marketing. It shows how efficiently your business runs day to day.

Operating profit margin = Operating income / Revenue * 100

Operating income = Gross profit – Operating expenses

Example:

If a business with $500,000 in revenue has $200,000 in operating expenses:

Operating income = $200,000 – $200,000 = $0

Operating profit margin = 0 / $500,000 * 100 = 0%

This result indicates that operating costs fully absorb gross profit.

Net profit margin formula

Net profit margin is the most comprehensive profitability metric. It accounts for all costs, including operating expenses, interest, taxes, and one-time charges.

Net profit margin = Net income / Revenue * 100

Example:

  • Net income = $50,000
  • Revenue = $500,000

Net profit margin = $50,000 / $500,000 * 100 = 10%

This margin shows how much profit ultimately flows to the bottom line after all expenses are paid.

Profit margin formulas at a glance

Margin typeFormulaWhat it shows
Gross profit margin(Revenue – COGS) / Revenue * 100Profit after direct costs
Operating profit marginOperating income / Revenue * 100Efficiency of core operations
Net profit marginNet income / Revenue * 100Bottom-line profitability

​​Profit margin: Real-world examples

Formulas are easier to understand when you see how they apply to real businesses. The examples below show how gross, operating, and net profit margins work in practice.

Retail business example

This example shows how a typical retail business moves from revenue to net profit after accounting for inventory, overhead, and taxes.

ItemAmount
Revenue$500,000
Cost of goods sold$300,000
Gross profit$200,000
Gross profit margin40%
Operating expenses$120,000
Operating income$80,000
Operating profit margin16%
Other expenses (taxes and interest)$30,000
Net income$50,000
Net profit margin10%

This result shows solid product pricing, but overhead costs reduce bottom-line profitability.

Service business example

Service businesses often post higher margins because direct costs are relatively low compared to revenue.

ItemAmount
Revenue$250,000
Contractor costs$50,000
Gross profit$200,000
Gross profit margin80%
Operating expenses$120,000
Operating income$80,000
Operating profit margin32%
Other expenses$20,000
Net income$60,000
Net profit margin24%

Lower cost structures allow service firms to retain more profit at each stage of the calculation.

E-commerce example

This example highlights how fulfillment, marketing, and platform fees affect margins in e-commerce.

ItemAmount
Revenue$1,000,000
COGS and fulfillment$500,000
Gross profit$500,000
Gross profit margin50%
Operating expenses$300,000
Operating income$200,000
Operating profit margin20%
Platform fees, returns, and taxes$50,000
Net income$150,000
Net profit margin15%

Tracking every cost category is especially important in e-commerce, where fees and returns can materially affect profitability.

How to calculate profit margin in Excel

Excel makes it easy to calculate and track profit margins by linking revenue and cost data directly to formulas. Once set up, your margins update automatically as numbers change.

Assign the following cells:

  • B2 = Revenue
  • B3 = Cost of goods sold
  • B4 = Operating expenses
  • B5 = Other expenses

Use these formulas:

  1. Gross profit margin: =(B2-B3)/B2
  2. Operating profit margin: =(B2-B3-B4)/B2
  3. Net profit margin: =(B2-B3-B4-B5)/B2

After building your Excel template, you can automate margin tracking with a few simple improvements. Using named ranges instead of raw cell references makes formulas easier to read and audit. Data validation rules help prevent errors by limiting inputs to valid numbers.

You can also link your spreadsheet to accounting exports so revenue and expense data update automatically. This reduces manual work and keeps profit margin calculations accurate as the business grows.

What is a good profit margin?

A good profit margin depends on your industry and business model. Retail businesses often operate with thinner margins than service or software companies, where direct costs are lower.

Grocery stores typically report net profit margins below 5% due to high competition and inventory turnover. Manufacturing businesses often fall between 5% and 10%, reflecting higher capital and labor costs. Professional services and consulting firms frequently exceed 15%, while software and software-as-a-service (SaaS) companies may target 20% or higher once they reach scale.

The table below provides a general benchmark for interpreting net profit margins:

Net profit marginWhat it means
Below 5%Tight margins with little room for error
Around 10%Generally healthy and sustainable
Above 20%Strong performance and high efficiency

Benchmarks provide helpful context, but trends over time often matter more than any single percentage. Tracking your margin consistently helps you spot early signs of cost pressure or pricing issues.

Factors affecting profit margins

Profit margins are shaped by a mix of internal decisions and external forces. Pricing, cost control, and efficiency all play a role, but competition and market conditions can matter just as much.

Competition level

In highly competitive markets, businesses often lower prices to attract or retain customers, which compresses margins. This dynamic is common in retail, food service, and consumer goods, where alternatives are plentiful and switching costs are low.

Companies with strong differentiation or brand loyalty can sustain higher margins even in crowded markets. Unique features, specialized expertise, or superior service reduce price sensitivity and help protect profitability.

Business model

Your business model directly affects margin potential. Asset-heavy models, such as manufacturing or logistics, tend to face higher fixed costs that limit margins.

Asset-light models, including consulting and software, often achieve higher margins because they rely more on labor or intellectual property than physical assets. Once fixed costs are covered, additional revenue contributes more directly to profit.

Operating efficiency

Efficient operations help control costs without sacrificing quality. Streamlined workflows, automation, and strong vendor management all support healthier margins.

Inefficiencies quietly erode profit over time. Redundant tools, manual processes, and limited spending visibility can drag margins down even as revenue grows.

Market conditions

External conditions can quickly affect margins in ways you can’t fully control:

  • Inflation increases input and labor costs
  • Supply chain disruptions raise COGS
  • Economic downturns pressure pricing and demand

Businesses that monitor margins closely can respond faster to these shifts and take corrective action before profitability suffers.

How to improve your profit margins

Improving profit margins usually comes from a mix of smarter pricing, tighter cost control, and better visibility into spending rather than blanket cost cutting.

The strategies below focus on changes you can make without sacrificing growth or customer experience:

  • Increase prices strategically: Small, targeted price increases can meaningfully improve margins when customers perceive clear value. Test changes gradually to minimize churn while improving profitability.
  • Reduce COGS through negotiation or efficiency: Renegotiating supplier contracts or improving production processes directly boosts gross margin. Even modest savings compound as volume grows.
  • Cut unnecessary operating expenses: Eliminating redundant software, underused subscriptions, or inefficient workflows trims overhead without hurting output. Regular expense reviews help prevent cost creep.
  • Improve inventory management: Better forecasting reduces overstock, storage costs, and markdowns, which helps protect margins and improve cash flow.
  • Focus on higher-margin products or services: Not all revenue contributes equally to profit. Prioritizing offerings with stronger margins can improve overall profitability even if total sales stay flat.

Track profit margins in real time with Ramp's automated expense categorization and reporting

Calculating profit margins accurately requires clean expense data, but manual categorization and scattered receipts create opportunities for error. Ramp's accounting automation software eliminates the guesswork by coding every transaction automatically, collecting receipts in real time, and syncing everything to your ERP so you always know where your money goes.

Ramp's AI learns your chart of accounts and applies the right GL codes, departments, classes, and locations to every expense as it posts. You get complete visibility into cost centers and spending patterns without chasing down receipts or fixing miscoded transactions after the fact. When expenses land in the right categories from day one, you can calculate margins with confidence and spot trends before they impact profitability.

Here's how Ramp helps you track and improve margins:

  • AI-powered coding: Ramp codes transactions across all required fields in real time, so expenses are categorized correctly and margins reflect actual costs
  • Automated receipt collection: Ramp texts employees for missing receipts and matches them to transactions automatically, eliminating the manual work that slows down reporting
  • Real-time spend visibility: Track expenses by department, project, or cost center as they happen, so you can identify margin erosion early and adjust spending before it's too late
  • Seamless ERP sync: Ramp syncs coded transactions to your accounting system automatically, so financial reports are always current and margin calculations are based on complete data

Try a demo to see how Ramp gives you the clean expense data you need to calculate and improve profit margins.

Try Ramp for free
Share with
Ken BoydAccounting and finance expert
Ken Boyd is a former CPA, accounting professor, writer, and editor. He has written four books on accounting topics, including The CPA Exam for Dummies. Ken has filmed video content on accounting topics for LinkedIn Learning, O’Reilly Media, Dummies.com, and creativeLIVE. He has written for Investopedia, QuickBooks, and a number of other publications. Boyd has written test questions for the Auditing test of the CPA exam, and spent three years on the Audit staff of KPMG.
Ramp is dedicated to helping businesses of all sizes make informed decisions. We adhere to strict editorial guidelines to ensure that our content meets and maintains our high standards.

In the public sector, every hour and every dollar belongs to the taxpayer. We can't afford to waste either. Ramp ensures we don't.

Carly Ching

Finance Specialist, City of Ketchum

City of Ketchum

Ramp gives us one structured intake, one set of guardrails, and clean data end‑to‑end— that’s how we save 20 hours/month and buy back days at close.

David Eckstein

CFO, Vanta

How Vanta runs finance on Ramp with programmatic spend for 3 days faster close

Ramp is the only vendor that can service all of our employees across the globe in one unified system. They handle multiple currencies seamlessly, integrate with all of our accounting systems, and thanks to their customizable card and policy controls, we're compliant worldwide.

Brandon Zell

Chief Accounting Officer, Notion

How Notion unified global spend management across 10+ countries

When our teams need something, they usually need it right away. The more time we can save doing all those tedious tasks, the more time we can dedicate to supporting our student-athletes.

Sarah Harris

Secretary, The University of Tennessee Athletics Foundation, Inc.

How Tennessee built a championship-caliber back office with Ramp

Ramp had everything we were looking for, and even things we weren't looking for. The policy aspects, that's something I never even dreamed of that a purchasing card program could handle.

Doug Volesky

Director of Finance, City of Mount Vernon

City of Mount Vernon addresses budget constraints by blocking non-compliant spend, earning cash back with Ramp

Switching from Brex to Ramp wasn't just a platform swap—it was a strategic upgrade that aligned with our mission to be agile, efficient, and financially savvy.

Lily Liu

CEO, Piñata

How Piñata halved its finance team’s workload after moving from Brex to Ramp

With Ramp, everything lives in one place. You can click into a vendor and see every transaction, invoice, and contract. That didn't exist in Zip. It's made approvals much faster because decision-makers aren't chasing down information—they have it all at their fingertips.

Ryan Williams

Manager, Contract and Vendor Management, Advisor360°

How Advisor360° cut their intake-to-pay cycle by 50%

The ability to create flexible parameters, such as allowing bookings up to 25% above market rate, has been really good for us. Plus, having all the information within the same platform is really valuable.

Caroline Hill

Assistant Controller, Sana Benefits

How Sana Benefits improved control over T&E spend with Ramp Travel