Gross Margin Calculator Formula
Understand the math behind the gross margin calculator. Each variable explained with a worked example.
Formulas Used
Gross Margin
gross_margin = revenue > 0 ? ((revenue - cogs) / revenue) * 100 : 0Gross Profit
gross_profit = revenue - cogsCOGS as % of Revenue
cogs_ratio = revenue > 0 ? (cogs / revenue) * 100 : 0Variables
| Variable | Description | Default |
|---|---|---|
revenue | Revenue(USD) | 200000 |
cogs | Cost of Goods Sold (COGS)(USD) | 80000 |
How It Works
How to Calculate Gross Margin
Formula
Gross Margin % = [(Revenue - COGS) / Revenue] x 100
Gross margin measures how efficiently a company generates profit from its direct costs. A higher gross margin means more money is available to cover operating expenses and generate net profit.
Worked Example
A company has $200,000 in revenue and $80,000 in cost of goods sold.
- 01Gross profit = $200,000 - $80,000 = $120,000
- 02Gross margin = ($120,000 / $200,000) x 100 = 60%
- 03COGS ratio = ($80,000 / $200,000) x 100 = 40%
Frequently Asked Questions
What is included in COGS?
COGS includes all direct costs to produce goods: raw materials, direct labor, manufacturing overhead, freight-in, and packaging. It does not include selling, administrative, or other indirect expenses.
What is a good gross margin?
Software: 60-90%, Professional services: 50-70%, Manufacturing: 25-40%, Retail: 25-50%, Restaurants: 55-65%. Higher is better within your industry.
Learn More
Guide
How to Calculate Profit Margin
Learn how to calculate gross, operating, and net profit margins step by step. Understand what healthy margins look like across industries and how to improve yours.
Ready to run the numbers?
Open Gross Margin Calculator