How to Calculate the Correct Amount with Stripe Fees Included

When processing payments through Stripe, you need to account for their fees to ensure you receive the exact amount you want. The formula below calculates the total amount a customer should be charged, factoring in Stripe's fixed and percentage fees:

$$A = \frac{C + r \times P}{1 - r}$$

where:

  • A is the total amount to charge the customer,

  • C is the fixed cost (e.g., $0.30 for Stripe’s fee),

  • P is the principal amount (the amount you want to receive),

  • r is the percentage fee as a decimal (e.g., 2.9% = 0.029).

Example Calculation

Let’s say you want to receive $100 after Stripe's fees. If Stripe charges 2.9% + $0.30 per transaction, the calculation works like this:

$$A = \frac{0.30 + 100 \times 0.029}{1 - 0.029} = \frac{3.20}{0.971} = 103.30$$

Thus, you need to charge the customer $103.30 to ensure you receive $100 after the fees.

Verifying the Calculation

To verify, calculate Stripe's fee for a $103.30 charge:

$$\text{Stripe Fee} = (103.30 \times 0.029) + 0.30 = 3.30$$

Subtracting the fee from $103.30 gives you exactly $100, confirming the formula's accuracy.