BYTETOOLS

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

  1. Pick your currency. Choose the symbol that matches your figures so the output reads correctly.
  2. Enter total revenue. Use the sales figure for the period, product, or line you're analyzing.
  3. Enter cost of goods sold. Add up the direct costs of what you sold in that same period.
  4. 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 COGSExclude from COGS
Raw materialsRent and utilities
Manufacturing laborMarketing and advertising
Inbound freightAdmin and office salaries
Wholesale purchase costSoftware 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

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.