What is Profit Margin?

Profit Margin (specifically Gross Profit Margin) measures the percentage of every sales dollar retained as profit after paying for the product’s cost of goods sold (COGS).

$$\text{Gross Margin (%)} = \left( \frac{\text{Selling Price} - \text{Cost of Goods Sold (COGS)}}{\text{Selling Price}} \right) \times 100$$

Calculation Example

If a merchant sells a jacket for $100 and its COGS (unit manufacture/wholesale cost) is $40:

$$\text{Gross Margin} = \left( \frac{100 - 40}{100} \right) \times 100 = 60%$$

For every $100 sale, the merchant retains $60 (60%) to cover operating expenses, ad spend, and net profit.

Common Confusion

Developer Takeaway

Cost Price Tracking: Ensure product variant database models store a cost_price attribute alongside price so business dashboards can calculate real-time profit margins automatically.