I’m working with tax-inclusive prices and need to calculate the net amount and VAT amount before sending the values to an accounting system through an API.
For example, if the total amount is £120.00 and VAT is 20%, I would expect:
- Gross amount: £120.00
- Net amount: £100.00
- VAT: £20.00
The formula I’m using is:
Net = Gross ÷ (1 + VAT rate / 100)
I’m mainly trying to avoid rounding differences when the original amount has more than two decimal places.
I found it useful to verify the calculation with an online reverse sales tax calculator for finding the original price before tax, especially when testing different VAT rates.
For developers integrating tax-inclusive invoices, how do you normally handle the rounding—calculate the VAT first and derive the net amount, or calculate the net amount first and then derive the VAT?