Given a revenue figure and a cost of goods sold figure, what is the gross profit, gross margin, COGS ratio, and markup on COGS — and how does each metric serve a different operational question?

This tool is for: E-commerce and retail operators tracking product-level profitability before operating overhead · Small-business owners pricing inventory and needing to separate product margin from overall business margin · Founders and operators who need to distinguish gross margin from net margin and markup from margin without conflating them

Total sales revenue for the period or transaction before any costs are subtracted. Must be greater than zero for gross margin and COGS ratio to be defined.
The direct cost tied to the goods or services sold — materials, direct labor, and manufacturing overhead allocated to units sold. Does not include operating expenses such as rent, salaries, or marketing.

Formulas Used

Gross Profit

Gross Profit = Revenue − Cost of Goods Sold

Where: Revenue = Total sales for the period or transaction (USD), Cost of Goods Sold = Direct cost of the units sold — materials, direct labor, allocated manufacturing overhead (USD)

Source: U.S. Small Business Administration — Manage Your Finances

Gross Margin

Gross Margin = (Revenue − COGS) / Revenue

Where: Revenue = Total sales for the period (USD), COGS = Cost of goods sold for the same period (USD)

Source: OpenStax — Principles of Accounting, Volume 2: Managerial Accounting

Markup on COGS

Markup on COGS = (Revenue − COGS) / COGS

Where: Revenue = Selling price for the unit or period (USD), COGS = Cost of goods sold — the denominator; undefined when COGS is zero (USD)

Source: OpenStax — Principles of Accounting, Volume 2: Managerial Accounting

Key Insight

Gross margin and markup measure the same gross profit against different denominators. A product with $400 gross profit on $1,000 revenue and $600 COGS has a 40% gross margin but a 66.67% markup. Pricing to a 50% markup target produces a 33.33% gross margin — not 50%. The gap between the two grows as margin rises: a 100% markup is a 50% gross margin, a 300% markup is a 75% gross margin. E-commerce and retail operators who conflate the two routinely misprice inventory and overstate product profitability.

Frequently Asked Questions

What is the difference between gross margin and net profit margin?

Gross margin covers only the cost of goods sold — direct materials, direct labor, and allocated manufacturing overhead for the units sold. Net profit margin subtracts all remaining expenses (operating costs, interest, taxes) from the same revenue. A business can have a healthy 45% gross margin and a slim or negative net margin if fixed overhead is large. Gross margin tells you whether the product is priced right relative to its direct cost; net margin tells you whether the entire business is profitable. This calculator computes gross margin only.

What does a negative gross margin mean?

A negative gross margin means cost of goods sold exceeds revenue — the business is selling each unit at a loss before any overhead is counted. No amount of volume or operational efficiency can compensate for a negative gross margin because the loss deepens with each unit sold. The fix is to raise the selling price, reduce direct costs, or discontinue the product. The COGS ratio output will exceed 100% in this case, confirming the problem in a different form.

Why is markup on COGS returned as null when COGS is zero?

Markup divides gross profit by cost of goods sold. When COGS is zero, the denominator is zero and the result is mathematically undefined — any markup percentage would be infinite. The calculator returns null rather than a large number to flag this clearly. Gross margin and COGS ratio remain computable in this case (100% and 0% respectively) because they divide by revenue, which is nonzero. A zero-COGS product is unusual in physical goods but can occur in digital products or services where the incremental cost of delivery is treated as zero.

About This Calculator

Sources:

Limitations:

When to consult a professional: Before using a gross margin figure in a financial statement, investor document, lender covenant, or tax filing — an accountant can confirm whether the COGS classification matches the accounting standard used by the relevant audience

This calculator computes gross-margin figures from a revenue and cost of goods sold pair. It does not classify costs — the user is responsible for ensuring that the COGS input excludes operating expenses. The result is a planning and pricing reference, not an audited accounting output. It does not constitute business or financial advice.

Related Calculators