How to calculate and track contribution margin
A practical guide to measuring the profit each order actually contributes to your business
Contribution margin is your most important profit metric
Contribution margin tells you how much each order actually contributes to covering fixed costs and generating profit. It’s more actionable than gross margin and more accurate than revenue for understanding business health.
Yet many e-commerce founders don’t calculate it or calculate it incorrectly. Here’s how to do it right.
The contribution margin formula
Contribution margin equals revenue minus all variable costs associated with that revenue.
The formula:
Revenue - COGS - Shipping - Payment Processing - Fulfillment = Contribution Margin
As a percentage:
Contribution Margin / Revenue = Contribution Margin Percentage
A $100 order with $55 in variable costs has $45 contribution margin, or 45% contribution margin percentage.
Identifying your variable costs
Variable costs change with order volume. If you ship more orders, these costs increase proportionally.
Cost of goods sold (COGS):
What you paid for the product. Include the purchase price plus any inbound freight to get it to your warehouse. If you manufacture, include materials and direct labor.
Outbound shipping:
What you pay to ship orders to customers. This might be a flat rate, weight-based, or zone-based cost. Include the actual carrier cost, not what you charge customers.
Payment processing:
Credit card fees, PayPal fees, Shopify Payments fees. Typically 2.5-3.5% of order value plus a fixed per-transaction fee.
Fulfillment costs:
Pick, pack, and ship labor. If you use a 3PL, this is your per-order fee. If you fulfill in-house, estimate the labor cost per order.
Packaging materials:
Boxes, tape, packing materials, inserts. These vary with order volume.
What not to include in variable costs
Some costs feel variable but shouldn’t be in contribution margin.
Marketing costs:
Generally treat marketing as a separate line item, not part of contribution margin. This lets you see order-level economics before acquisition costs. Some businesses include performance marketing in contribution margin—either approach works if you’re consistent.
Fixed overhead:
Rent, salaries, software subscriptions, and other costs that don’t change with order volume. These are fixed costs covered by contribution margin, not subtracted from it.
Returns processing:
Handle returns separately. They’re important but complicate order-level contribution calculation. Track return costs and their impact on overall contribution.
Calculating at the order level
The most accurate contribution margin comes from order-level calculation.
Why order level matters:
Orders vary. A $50 order with free shipping has different contribution than a $150 order. Averaging across all orders hides this variation.
Order-level calculation:
For each order, subtract its specific variable costs. The product cost for items in that order. The actual shipping paid for that order. The payment processing on that order’s total. The fulfillment cost for that order’s item count.
Practical approach:
Most businesses can’t calculate every order individually in real-time. Instead, build a model with accurate cost assumptions and apply it to orders. Periodically validate that assumptions match reality.
Setting up contribution margin tracking
How do you actually implement contribution margin tracking?
Product-level cost data:
Maintain accurate cost for every SKU. Update when costs change. This is the foundation of contribution calculation.
Shipping cost assignment:
Use your actual carrier costs, not shipping revenue. If you charge $8 but pay $12, your contribution calculation needs the $12 cost.
Processing fee calculation:
Apply your actual payment processor rates to order totals. Include both percentage and per-transaction fees.
Fulfillment cost assignment:
Estimate per-order fulfillment cost. If you use a 3PL, use their rates. If in-house, calculate based on labor time and cost.
Using spreadsheets for contribution margin
For many businesses, spreadsheets work for contribution tracking.
Basic setup:
Export orders with revenue and items. Look up product costs. Apply shipping, processing, and fulfillment estimates. Calculate contribution per order. Aggregate to totals and averages.
Advantages:
Flexible and customizable. No additional tools needed. Full control over calculation methodology.
Limitations:
Manual and time-consuming. Prone to errors. Difficult to maintain at scale.
Using analytics tools for contribution margin
Dedicated tools can automate contribution tracking.
E-commerce analytics platforms:
Some analytics platforms calculate contribution margin automatically if you provide cost data. They apply costs to orders and track contribution over time.
Integration requirements:
You need to feed accurate cost data into whatever system you use. The tool can do the math, but garbage in means garbage out.
Tracking contribution margin over time
Contribution margin should be tracked regularly and trended over time.
Monthly tracking:
Calculate contribution margin monthly at minimum. Track the total, the per-order average, and the percentage.
Trend analysis:
Is contribution margin improving or declining? Gradual declines indicate cost increases or mix shifts. Sudden drops need immediate investigation.
Seasonality awareness:
Contribution margin might vary seasonally. Holiday shipping costs might be higher. Promotional periods have lower margins. Compare to same period last year.
Segmenting contribution margin
Aggregate contribution margin hides important variation.
By product:
Some products have high contribution margin; others are marginal or negative. Know which is which.
By channel:
Orders from different channels might have different contribution. Marketplace orders might have additional fees. Direct orders might have different shipping patterns.
By customer type:
New customers might have different contribution than returning customers. Different shipping choices, different product preferences.
By order size:
Small orders often have worse contribution margin percentage due to fixed per-order costs. Large orders might have better percentage contribution.
Using contribution margin for decisions
Contribution margin should inform business decisions.
Pricing decisions:
If contribution margin is too low, prices need to increase or costs need to decrease. The number tells you how much room you have or don’t have.
Product decisions:
Promote high-contribution products. Consider discontinuing negative-contribution products. Let contribution guide product strategy.
Shipping strategy:
Free shipping thresholds should consider contribution margin. Ensure orders receiving free shipping have adequate contribution to absorb the cost.
Promotion strategy:
Discounts reduce contribution margin. Understand how much margin you have to work with before offering promotions.
Common contribution margin mistakes
Avoid these errors in contribution calculation.
Missing costs:
Every variable cost matters. Missing a $2 fulfillment cost on thousands of orders adds up significantly.
Outdated product costs:
Product costs change. Supplier prices increase. Shipping costs rise. Update your cost data regularly.
Ignoring shipping reality:
Using shipping revenue instead of shipping cost inflates contribution margin. Use actual costs.
Inconsistent methodology:
Whatever you include or exclude, be consistent over time. Changing methodology breaks trend comparisons.
Metrics to track for contribution margin
Focus on these contribution margin metrics:
Total contribution margin (dollars). Contribution margin per order. Contribution margin percentage. Contribution margin by product. Contribution margin by channel. Contribution margin by order size. Contribution margin trend over time.
Contribution margin is the truest measure of order-level profitability. Track it accurately, segment it usefully, and let it guide your decisions.

