How to Calculate Gross Profit and Margin (Step by Step)
Gross profit is your revenue minus the cost of goods sold, and gross profit margin is that profit divided by revenue, times 100. Enter both figures into the ByteTools Gross Profit Calculator and it returns the profit in currency and the margin percentage instantly — all calculated privately in your browser.
This guide shows exactly how the calculation works, how to use the tool, and how to read the results so you can price products and report profitability with confidence. Nothing is uploaded, so your revenue and cost numbers stay on your device.
The formula behind the tool
Two simple equations do all the work:
- Gross profit = Revenue − Cost of Goods Sold (COGS)
- Gross profit margin = (Gross profit ÷ Revenue) × 100
For example, on $100,000 of revenue with $60,000 of COGS, gross profit is $40,000 and the margin is 40%. The calculator performs both steps for you and even handles the case where costs exceed revenue, showing a loss rather than an error.
Step-by-step with the calculator
- Pick your currency. Choose the symbol that matches your figures so the output reads correctly.
- Enter total revenue. Use the sales figure for the period, product, or line you're analyzing.
- Enter cost of goods sold. Add up the direct costs of what you sold in that same period.
- Read the results. The tool displays gross profit in currency and the gross profit margin as a percentage.
Keep revenue and COGS aligned to the same scope and time frame — mixing a month of revenue with a year of costs produces a meaningless margin.
What counts as cost of goods sold
Getting COGS right is the key to an accurate margin. Include the direct costs of producing or buying what you sell; exclude indirect overheads.
| Include in COGS | Exclude from COGS |
|---|---|
| Raw materials | Rent and utilities |
| Manufacturing labor | Marketing and advertising |
| Inbound freight | Admin and office salaries |
| Wholesale purchase cost | Software and subscriptions |
Because those indirect costs are left out, gross profit is always higher than net profit — it measures profitability before overheads, not the bottom line.
Reading the result
The margin percentage is the number to watch over time. A rising margin means each sale keeps more to cover overheads; a falling one signals rising input costs or discounting. Use the currency figure for totals and the percentage for comparison across products or periods.
Try the Gross Profit Calculator — free and 100% in your browser.
FAQ
Do I enter revenue before or after tax?
Use net revenue — sales after returns and sales tax collected on behalf of the government are excluded. The goal is the actual income your business earns from selling goods, matched against the cost of those goods.
What if my costs are higher than my revenue?
The calculator handles it and shows a negative gross profit, meaning a gross loss. That signals you're selling below the direct cost of the goods, which usually calls for a pricing or sourcing review.
Can I calculate margin for a single product?
Yes. Enter that product's selling price as revenue and its unit cost as COGS. The tool works at product, line, or company level — just keep both inputs at the same scope.
Is my financial data safe in this tool?
Yes. Every calculation runs locally in your browser, and nothing is uploaded or stored. Your revenue and cost figures never leave your device.
Related free tools
- Margin & Markup Calculator — work between margin and markup on a price.
- Markup Calculator — set a selling price from cost and target markup.
- Break-Even Calculator — find the sales needed to cover costs.
- ROI Calculator — measure the return on an investment.
Built by ByteVancer
ByteTools is a free product of ByteVancer, a software and web development studio building web apps, SaaS, and custom software. If you need custom financial tooling or a full business application, explore what ByteVancer can build for you.
Recommended reading
Gross Profit Calculator Use Cases: Real Business Examples
See how retailers, freelancers, and finance students use a gross profit calculator with worked examples for pricing, reporting, and analysis.
Gross Profit Margin: Best Practices and Costly Mistakes
Avoid the common gross-margin mistakes — misclassified COGS, mismatched periods, and confusing margin with markup — with practical best practices.
Margin Calculator Use Cases: Real Pricing Examples
Real margin and markup use cases with worked examples for retailers, resellers, freelancers and quoting jobs — price with confidence in your browser.
Margin Calculator Tips: Price Smarter, Avoid Mistakes
Expert margin and markup pricing tips: dodge the margin-markup mix-up, protect profit against discounts, and avoid the costly pricing mistakes.