Tool · Investor Sam Biz

Gross Margin Calculator

June 30, 2026 • By the Investor Sam Editorial Team • Reviewed by Berly Sam Varghese, Editor
Gross margin is the single clearest measure of whether the core of your business makes money before overhead. It tells you what share of every sales dollar is left after the direct cost of producing what you sold. This calculator takes your revenue and cost of goods sold and returns gross profit, gross margin percentage, and the equivalent markup. Track it over time and you will spot rising costs or slipping prices long before they show up in the bottom line.

Example: Revenue (sales): 100000 $ · Cost of goods sold (COGS): 60000 $

Gross profit$40,000
Gross margin40.00%
Equivalent markup66.67%

Worked example

On $100,000 of revenue with $60,000 of cost of goods sold, gross profit is $40,000. Dividing $40,000 by the $100,000 of revenue gives a 40% gross margin. The same $40,000 over the $60,000 cost is a 66.7% markup. Margin and markup describe the same profit against different bases, which is why the two numbers differ.

Frequently asked questions

What is cost of goods sold?

COGS is the direct cost of producing what you sold: materials, direct labor, and manufacturing or purchase costs. It excludes overhead like rent, marketing, and administrative salaries, which fall below the gross-profit line.

What is a good gross margin?

It varies widely by industry. Software can exceed 80%, retail often sits around 25 to 50%, and grocery runs much thinner. Compare yours to peers in your sector rather than to an absolute benchmark.

How is gross margin different from net margin?

Gross margin subtracts only the direct cost of goods; net margin subtracts everything, including overhead, marketing, interest, and taxes. Gross margin measures the health of your product; net margin measures the health of the whole business.

Why track gross margin over time?

A falling gross margin is an early warning that input costs are rising or your prices are slipping. Catching that trend early lets you raise prices or renegotiate costs before it erodes profit.

💎
InvestorSam.com
Stock analysis, market insights & portfolio research — free
Ready to put these numbers to work?
Get stock picks, earnings analysis, and market commentary from Investor Sam.
Visit InvestorSam.com →

Sources

Berly Sam Varghese · Editor, Investor Sam

Berly Sam Varghese is an engineer who treats money the way he treats any hard problem — something to be engineered, not gambled on. He funded years of education and built real financial stability the patient way, by living below his means and investing rather than borrowing. He writes for the person building something and trying to keep the finances sane. He reviews and approves every article on Investor Sam and checks the figures against primary sources before anything is published. More about our standards.