How to calculate the real profit on an online sale
Updated October 16, 2026
Selling more doesn’t always mean earning more. To know how much each sale really leaves you with, you need to set aside the VAT, which isn’t yours, and subtract everything the sale costs: the product, shipping, packaging and fees. This guide walks you through it step by step, with an example you can repeat with your own figures in the Margnexa calculator.
1. Selling price and revenue
What you charge the customer is the item price, minus discounts, plus any shipping you charge. If you sell to consumers in Spain, that amount includes VAT, and VAT isn’t revenue for you: you pay it to the Spanish Tax Agency.
To get revenue excluding VAT, divide the amount charged by 1 plus the VAT rate. At the standard 21% rate, divide by 1.21. A common mistake is to subtract 21% from the total: with €34.80 charged, 34.80 × 0.79 gives €27.49, whereas revenue excluding VAT is 34.80 ÷ 1.21 = €28.76.
2. Product acquisition cost
This is what each unit you sell costs you: the purchase price from your supplier or the cost of making it, plus whatever you pay to get it ready for sale, such as inbound shipping from the supplier spread across units. If your supplier invoices you with VAT and you can deduct it, the cost that counts is the amount excluding VAT.
3. Shipping and packaging costs
- The shipping you pay the carrier is a cost, even if you charge it to the customer: what you charge goes into revenue (step 1) and what you pay goes here. If you offer free shipping, there’s no shipping revenue, but the cost is still there.
- Packaging (box, filler, labels) is also counted per unit sold.
4. Platform and payment fees
Marketplaces usually charge a fee on each sale, and in your own store you pay the payment gateway for each charge. A fee can be a percentage, a fixed amount or both, sometimes with a minimum. The percentage is applied to a base that varies from one platform to another: the item price or the total including shipping, with or without VAT.
Fees change and can depend on the product category, the country or the plan you’re on. Always check each platform’s current terms. Margnexa doesn’t come with preloaded fees: you enter them yourself, along with their base and whether the amount includes VAT.
Monthly subscriptions, such as your online store plan, don’t depend on each sale and aren’t part of this per-sale calculation, but the profit from your sales each month has to cover them.
5. VAT, as a guide
- VAT you charge (output VAT): you pay it to the Tax Agency, so it isn’t revenue.
- VAT you pay on your purchases and fees (input VAT): if you can deduct it, you subtract it from the VAT you pay over and it isn’t a cost. If you can’t deduct it, it’s one more cost. Having an invoice doesn’t by itself mean you can deduct it.
- Estimated VAT payable = output VAT − deductible input VAT.
- The standard rate is 21%, but some products have reduced rates: check the one that applies to yours.
Margnexa calculates using the general VAT regime in Spain (mainland and the Balearic Islands). It doesn’t cover, among others, the equivalence surcharge, the simplified regime, the Canary Islands, Ceuta and Melilla, or sales to other countries. The tax treatment of your business should be confirmed by your advisor.
6. Operating profit and margin
- Operating profit = revenue excluding VAT − costs − fees (excluding deductible VAT; non-deductible VAT is added as a cost).
- Profit margin = operating profit ÷ revenue excluding VAT. It shows how much of each euro of revenue you keep.
- Return on costs = operating profit ÷ (costs + fees). It isn’t the same as margin: when there’s a profit, it gives a higher figure.
This is profit before income tax (Spanish personal income tax or corporate tax), the self-employed contribution and the business’s fixed costs.
7. Break-even price
This is the lowest selling price at which a sale doesn’t lose you money: operating profit is zero. Adding up the costs isn’t enough, because percentage fees and VAT change with the price. Margnexa calculates the exact price for each channel and rounds it up to the next cent.
8. Worked example
A product sells for €29.90 including VAT and €4.90 is charged for shipping including VAT (21% rate). The product costs €9.50 and shipping €4.20, both excluding VAT and with deductible VAT; packaging costs €0.60 including VAT, also deductible. The payment gateway charges 2.5% of the total charged plus €0.25 per sale, excluding VAT (with 21% deductible VAT). This fee is a made-up figure for the example, not that of any platform.
| Item | Calculation | Amount |
|---|---|---|
| Charged to the customer | 29.90 + 4.90 | €34.80 |
| Revenue excluding VAT | 34.80 ÷ 1.21 | €28.76 |
| Output VAT (for the Tax Agency) | 34.80 − 28.76 | €6.04 |
| Product cost | Excluding VAT | −€9.50 |
| Shipping | Excluding VAT | −€4.20 |
| Packaging | 0.60 ÷ 1.21 | −€0.50 |
| Payment gateway fee | 2.5% × 34.80 + 0.25 | −€1.12 |
| Operating profit | 28.76 − 9.50 − 4.20 − 0.50 − 1.12 | €13.44 |
| Profit margin | 13.44 ÷ 28.76 | 46.75% |
Estimated VAT payable is €2.82: €6.04 of output VAT minus €3.22 of deductible VAT (€2.00 from the product, €0.88 from shipping, €0.10 from packaging and €0.24 from the fee). Checking it with cash: you collect €34.80 and pay €17.18 in costs including VAT, €1.36 in fees including VAT and €2.82 to the Tax Agency. You’re left with €13.44, the operating profit.
With the same shipping, costs and fee, the break-even price is €13.13 including VAT: below that, this sale would make a loss.
Calculate it with your own figures
The Margnexa calculator opens with this same example if you don’t have a saved scenario. Replace the amounts with yours and add your sales channels to compare where you earn more on each sale. It’s free, needs no sign-up and your data stays in your browser.
This guide is for guidance only and isn’t a substitute for tax or accounting advice.