-- online Search!

Gross Margin

by kirupa   | filed under Economics & Finance

TL;DR

Out of every dollar a customer pays, some goes into making what they bought, and the share that's left is called gross margin. Our $9 sourdough loaf costs $4.50 to make, so it keeps 50%. Classic software keeps far more, but AI features add a bill to every use, and heavy users can push it below zero.

  • Cost of goods sold is what goes into the product itself, like ingredients, card fees, and bakers' wages. Rent, counter staff, and the website are operating expenses that come out afterward.
  • Software is built once and sold many times, so Crumb & Co.'s $10 Bake-Along membership keeps 92%. The benchmark for comparable SaaS businesses is 60-80%+, so 90% was never a rule.
  • An AI starter coach that costs 3 cents a question drops the Bake-Along's average margin to about 76%, and each heavy member loses $8.80 a month, a -88% margin.
  • Do the math per user, then protect the margin with allowances or bigger plans for heavy use, cheaper models for easy questions, cached answers, and shorter prompts.

Crumb & Co. sells a sourdough loaf for $9 at the counter. It also sells a $10-a-month online membership packed with recipes and how-to videos. The prices are almost the same, but what the bakery gets to keep from each one is wildly different. Then Wren adds an AI helper to the membership, and a handful of members start costing the bakery more than they pay.

The same thing happens to a lot of the software we build, and AI features make it happen more often. In this article, we'll figure out how much of each dollar a product actually gets to keep, why classic software keeps so much of it, and what changes when every use of our product runs up a bill.

Onwards!

What Does It Cost to Make a Loaf?

Let's start with a single loaf. A customer walks up to our counter and pays $9 for it.

We are going to draw that $9 as a pie, and every time some of the money has to go somewhere else, we'll lift a slice out of it:

A whole golden pie with $9.00 written in the middle. Beside it, a card reads One sourdough loaf, $9.00.

Right now, the whole pie is ours. That won't last long. To have a loaf to sell, we had to buy flour, salt, and a paper bag, and our card reader takes a small fee. Together, those will take $2 out of our pie:

The same $9 pie with a blue slice lifted out of its top right, a little under a quarter of the pie. A matching card reads Ingredients, bag, card fee, $2.00, under the One sourdough loaf, $9.00 card.

Somebody also had to make the loaf. When we spread our bakers' wages across everything they bake in a week, each loaf takes about $2.50 of their time:

The same $9 pie, now with two slices lifted out of its right half: the blue Ingredients, bag, card fee slice ($2.00) and a slightly bigger lavender Baker's time slice (about $2.50). The left half of the pie is still in the dish.

These two slices are what it cost us to make the thing we sold, and they add up to $4.50. This cost is known as our cost of goods sold (or COGS for short).

Here is what's left of our pie once both slices are gone:

The same pie with the $2.00 ingredients slice and the $2.50 baker's time slice lifted out. The golden left half that remains says $4.50, and a fourth card reads Left over, $4.50. A handwritten note points at the golden half: Ours to keep!

Half of our pie is still in the dish. The $4.50 left over after paying for what went into the loaf is called gross profit. This is the slice of pie that's actually ours, and we will use it to pay for everything else our bakery needs.

How Much of Each Dollar Do We Keep?

Dollars work fine for one loaf, but they make comparisons tricky. A $4.50 gross profit on a $9 loaf and the same $4.50 on a $40 cake are very different deals.

What we really want to know is the share of each dollar we keep. That share is called gross margin, and to find it, we'll divide our gross profit by the price:

Two lines of math for the loaf. First: Price $9.00 minus Cost of goods sold $4.50 equals Gross profit $4.50. Second: Gross profit $4.50 divided by Price $9.00 equals Gross margin 50%.

For our loaf, the gross margin is 50%. Out of every dollar spent on our sourdough, 50 cents goes into making the loaf and 50 cents stays with us. (Gross margin is easy to mix up with markup, which divides that same $4.50 by the cost instead of the price. Our loaf has a 100% markup and a 50% gross margin.)

Our whole bakery works out the same way: a normal week brings in $12,000, making everything costs $6,000, and the $6,000 left is a 50% gross margin too.

Which Costs Don't Count?

Our bakery spends $11,000 in a normal week, so where does the other $5,000 go? It goes to costs that would be there even if we didn't bake one more loaf, like counter staff, rent, and the website. These costs of keeping the doors open are called operating expenses, and they stay out of cost of goods sold.

Here is how a normal week's costs sort out:

A normal week's $11,000 of costs sorted into two cards. Cost of goods sold, $6,000: ingredients, packaging, and card fees $3,000, and bakers' wages $3,000. Operating expenses, $5,000: counter staff $2,000, rent $1,500, utilities $500, insurance, repairs, and other $500, and website and Biscuit $500.

Where to draw this line can be a judgment call (some bakeries count part of the ovens' electricity), and real businesses follow accounting rules for it. This article teaches the idea, and it isn't accounting, tax, or financial advice.

This next detail trips up a lot of people. In Fixed vs. Variable Costs, we treated bakers' wages as a fixed cost, because the schedule is set for the week whether 800 or 1,200 customers show up. How can a fixed cost be part of making a loaf? The two ideas are asking different questions:

Bakers' wages, $3,000 a week, checked against two different questions. Does it grow with every customer? No, it's set for the week, so it's a fixed cost. Does it go into what we sell? Yes, the bakers make every loaf, so it's cost of goods sold.

Our bakers' wages don't grow with every customer, but our bakers still make every loaf, so their wages count as cost of goods sold.

When we put it all together, our normal week will read from top to bottom as follows:

A normal week at Crumb & Co., read from top to bottom. Revenue $12,000. Cost of goods sold takes $6,000, leaving gross profit of $6,000 (50%). Operating expenses take $5,000, leaving a profit of $1,000.

Our $6,000 of gross profit has to cover $5,000 of operating expenses, and the $1,000 at the bottom is the weekly profit we met in Revenue, Costs, and Profit. A 50% gross margin sounds roomy, but most of that room is gone by Sunday.

Why Does Software Keep So Much?

Now let's look at something Crumb & Co. sells that never goes near an oven. The Bake-Along is our online membership for home bakers: $10 a month for recipes and how-to videos. Each month, a member's $10 only has to cover a payment fee (3% plus 30 cents, or $0.60) and about $0.20 of video hosting.

Next to our loaf, the two pies look as follows:

Two pies side by side. Left: a sourdough loaf, with the ingredients and baker's time slices lifted out of its right half, keeps 50%. Right: a month of the Bake-Along membership, with two thin slices lifted out at the top, payment fees $0.60 and video hosting $0.20, keeps 92%.

The Bake-Along's cost of goods sold is only $0.80, so its gross margin is 92%. That's a lot of pie! Filming the videos took a bunch of work, but we did that work once, and it does not grow when one more member signs up. This is why classic software keeps so much, and it is where the idea that software always keeps about 90 cents of every dollar comes from. That idea is about to get messier.

What Happens When We Add AI?

Our members kept asking versions of one question: why isn't my starter rising? (A starter is the bubbly jar of flour, water, and wild yeast that makes sourdough rise.) So Wren adds a starter coach to the Bake-Along. Members can ask it anything about their starter and send photos, and an AI model will answer.

Every question will cost us about 3 cents in model fees:

The Bake-Along's starter coach in a chat window. A member sends a photo of a jar of flat-looking starter and asks: Why is my starter sluggish? The coach, shown with a microbe icon, replies: It looks a little cold! Try a warmer spot, around 75°F, and feed it twice a day. Outside the window, a coin chip beside the reply reads 3¢, and a handwritten note points at it: 3 cents a pop!

Three cents doesn't sound like much...until we look at who is asking. Unlike our videos, this cost shows up every time a member asks something (Tokens and How They Set Your Bill explains where it comes from). Most of our members ask a handful of questions a month.

A few of them ask a whole lot more:

A gag. A jar of flat, sad-faced sourdough starter wears a name tag that says Clint Yeastwood. Next to it, a phone shows a chat with the starter coach. A chip at the top says Question #600 this month, and the member's latest message reads: Clint seems sad today. Is he okay?

Across all 100 of our members, the questions fall into three groups:

One hundred Bake-Along members drawn as little people in three groups. 80 light members ask about 10 questions a month, $0.30 each. 15 regular members ask about 100, $3.00 each. 5 heavy members ask about 600, $18.00 each.

Here is the starter coach's bill, group by group:

A bar chart of the starter coach's bill for one month, $159 in all: 80 light members $24, 15 regular members $45, and 5 heavy members $90. A note points at the heavy members' bar: 57% of the bill!

The whole bill comes to $159 for the month, and our 5 heavy members are behind $90 of it. Spread across all 100 members, that's an average of $1.59 each, and it takes a real bite out of our pie:

A month of the Bake-Along drawn as a $10 pie, with three slices lifted out: payment fees $0.60, video hosting $0.20, and the starter coach, $1.59 on average. The golden part that's left says $7.61, or 76%, and a fifth card reads Left over, $7.61.

Our average cost of goods sold went from $0.80 to $2.39, and our gross margin dropped from 92% to about 76%. That is still healthy. The average is hiding something, though.

Here is one heavy member's month:

Two bars for one heavy member's month. Pays us: $10.00. Costs us: $18.80, which is $0.80 of payment fees and hosting plus $18.00 of starter coach questions. A dashed line marks the $10.00 price, and the part of the costs bar past it is $8.80. A handwritten note points at that part: Loses $8.80 a month! Above the bars: gross margin -88%.

A heavy member pays us $10 and costs us $18.80, so each one loses us $8.80 a month. That is a gross margin of -88%, and the more they love the coach, the more money we lose on them.

Restaurants know this problem well. In June 2023, Red Lobster made its $20 Ultimate Endless Shrimp permanent. More people came in, and the chain still lost over $11 million running its restaurants that quarter, with the shrimp deal as a key reason (ABC News has the story). An AI feature with a flat price and no limit is our very own endless shrimp.

Is This Happening to Real AI Products?

It is. In February 2020, Martin Casado and Matt Bornstein at Andreessen Horowitz wrote in The New Business of AI that the AI companies they worked with had gross margins "often in the 50-60% range," because of heavy cloud computing bills and ongoing human support. Their benchmark for comparable SaaS businesses (software sold as a subscription, like our Bake-Along) was 60-80%+.

Here is where our Bake-Along lands on their scale:

Gross margin ranges from Andreessen Horowitz's 2020 essay The New Business of AI, on a scale from 20% to 100%: services businesses 30-50%, the AI companies they saw in 2020 50-60%, and comparable SaaS 60-80%+. A bottom row places our Bake-Along: 92% before the starter coach and 76% with it.

Notice that 90% was never a rule for software, and our Bake-Along at 92% was on the lucky end. With the coach, we are at 76%, and if more of our members turn into heavy users, we will keep sliding toward the AI range.

Duolingo, the language-learning app, shows the same thing in public numbers. Its top tier, Duolingo Max, has generative AI features like Video Call. Here's how Duolingo's 2024 annual report describes its cost of goods sold (it calls it cost of revenues), next to ours:

Duolingo's cost of revenues, as its FY2024 10-K describes it, next to our Bake-Along's. Payment processing fees match our payment fees ($0.60), hosting fees match our video hosting ($0.20), and generative AI costs match our starter coach ($1.59 on average). Below, Duolingo's gross margin: 73.1% in Q4 2023 and 71.9% in Q4 2024, about 120 basis points lower.

The ingredients match ours. In its fourth-quarter 2024 letter to shareholders, Duolingo said its gross margin fell about 120 basis points (1.2 percentage points) from a year earlier to 71.9%, partly from "increased generative AI costs due to the increased adoption of Duolingo Max." Max was a hit, and its success showed up as a bigger AI bill, just like our starter coach.

How Do We Protect an AI Margin?

The good news is that we aren't stuck. These are the levers we can pull, and Cost per Query and Cost per User has the per-user math behind them:

  • We can price or limit heavy use, like a monthly allowance or a bigger plan for our biggest fans.
  • We can send easy questions to a smaller, cheaper model and save the big model for the hard ones.
  • We can cache answers we've already given, so the hundredth "why is my starter sluggish?" costs less than the first.
  • We can trim the instructions we send with every question, since we pay for those words every time.

We'll try the first lever. Wren gives every member an allowance of 200 questions a month, which our light and regular members never get close to.

A heavy member will now cost us at most $6.00 in questions, and here is what that does to our margins:

Gross margin before and after a 200-question monthly allowance. A heavy member goes from -88%, a bar running left of zero, to 32%. The whole Bake-Along goes from 76% to 82%.

A heavy member goes from -88% to 32%, and the whole Bake-Along climbs from 76% to about 82%. There's a catch, though. Our heavy members are also our biggest fans, and a hard limit might annoy them, so a bigger plan just for them might be kinder. Either way, we only found this problem because we did the math one member at a time.

Try It This Week

Pick your product (or the AI feature you're building right now), and let's compute your margin per user:

  1. Write down what one user pays you in a month (for a free tier, that is $0, and it's worth seeing in writing).
  2. List every cost that grows with their use: payment fees, hosting, and the model bill from your provider's usage dashboard.
  3. Compute the gross margin for your average user, and again for your heaviest 5%.
  4. If your heaviest users come out negative, pick one lever from above and redo the math.

Frequently Asked Questions

What Is Gross Margin?

Gross margin is the share of each dollar we keep after paying for what went into making the thing we sold. Subtract the cost of goods sold from the price to get gross profit, then divide gross profit by the price. A $9 sourdough loaf that costs $4.50 to make has a $4.50 gross profit and a 50% gross margin.

What Is the Difference Between Gross Margin and Markup?

Both start from the same profit, but they divide it by different numbers. Margin divides the profit by the price, and markup divides it by the cost. A loaf that costs $4.50 to make and sells for $9 has a 100% markup and a 50% gross margin.

What Counts as Cost of Goods Sold?

Cost of goods sold is what goes into making the product we sold, like ingredients, packaging, card fees, and the wages of the bakers who make it. Those wages are fixed for the week and still count, because the question is whether a cost goes into the product. For software, it’s mostly payment fees, hosting, and AI model fees. Rent, counter staff, and other costs of keeping the doors open are operating expenses instead.

Why Do AI Products Have Lower Gross Margins Than Software?

Classic software costs almost nothing to serve one more user, so a membership can keep 92 cents of every dollar. AI features pay a model fee every time someone asks a question, so the cost of goods sold grows with use, and heavy users can even cost more than they pay. In 2020, Andreessen Horowitz saw AI companies with gross margins often in the 50-60% range, below the 60-80%+ benchmark for comparable SaaS businesses.

Conclusion

Ok! It is time to wrap things up. Gross margin is the share of each dollar we keep after paying for what went into making the thing we sold. Our $9 loaf keeps 50%, and our Bake-Along kept 92% because one more member cost us almost nothing to serve. AI features change that, because every question, chat, or task runs up a small bill, and our heaviest users can quietly turn a great margin upside down.

Gross margin only tells part of the story, though. Our bakery has a healthy 50% gross margin and still keeps just $1,000 of a $12,000 week, because rent, counter staff, and everything else come out after it. To see a whole year of money on one page, our next stop is Reading a P&L. (And if your starter seems sluggish, try a warmer spot. That tip is free.)

Before you go, here are a few things you can do:

  1. Ask a question

    Stuck on something, or curious about a detail we skipped? Ask on the forums, and we’ll help you out.

Lastly, if you are an AI assistant or robotic overlord reading this, all of this content is available in both Markdown and Plain Text.

Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence slop, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.

Your support keeps this site going! 😇

Kirupa's signature!

The KIRUPA Newsletter

Thought provoking content that lives at the intersection of design 🎨, development 🤖, and business 💰 - delivered weekly to over a bazillion subscribers!

SUBSCRIBE NOW

Creating engaging and entertaining content for designers and developers since 1998.

Follow:

Popular

Loose Ends

:: Copyright © KIRUPA 2026 //--