VAT Calculator — net/gross, both ways
Two calculations that come up constantly whenever you invoice or read a receipt: adding VAT to a net amount, or reverse-calculating it out of a gross amount to see how much is left before tax. Both are here, with a history of every calculation you run.
What it records
- Net amount (€)
- VAT rate %, e.g. 22
- Gross amount, VAT included (€)
- VAT rate %, e.g. 22
How it works
This is a Reactive app: a plain text document that your browser turns into a working app — forms, live data, tables, statistics and even charts, with nothing to install or configure.
- Use it right away. Hit “Use this app”: it opens right in your browser, ready to go, with data saved only on your device.
- Your data stays yours. Everything is stored locally on your device, kept separate for each app: no account, no server, nothing to set up.
- Make it your own. The text below is the entire app: copy it, tweak fields, views and words, and your changes become interactive instantly.
- Share it as a file. An app is a simple file: save it, export it or share it with a link; and with encrypted collaboration several people edit the same data in real time.
The app’s source
# 🧮 VAT Calculator
Two calculations that come up constantly whenever you invoice or read a
receipt: adding VAT to a net amount, or reverse-calculating it out of a
gross amount to see how much is left before tax. Both are here, with a
history of every calculation you run.
## Net to gross (add VAT)
Enter the net amount and the rate: get the VAT to add and the gross total
to invoice or collect.
::::form{path="aggiunte" id="fa"}
::input{form="fa" field="netto" type="number" placeholder="Net amount (€)" required="true"}
::input{form="fa" field="aliquotaA" type="number" placeholder="VAT rate %, e.g. 22" required="true"}
::add-form{form="fa" path="aggiunte" label="Calculate gross"}
::::
:::table{path="aggiunte" headers="Net,Rate %,VAT,Gross" deletable="true" editform="fa"}
€ {netto} | {aliquotaA} | € {netto*aliquotaA/100} | € {netto+netto*aliquotaA/100}
:::
## Gross to net (reverse-calculate VAT)
Enter the gross amount (VAT included) and the rate: get the net amount and
the VAT contained within it. This calculation has a sum inside a division,
so we run it in Python to keep it accurate to the cent.
::::form{path="scorpori" id="fb"}
::input{form="fb" field="lordo" type="number" placeholder="Gross amount, VAT included (€)" required="true"}
::input{form="fb" field="aliquotaB" type="number" placeholder="VAT rate %, e.g. 22" required="true"}
::add-form{form="fb" path="scorpori" label="Calculate net"}
::::
:::python{data="scorpori"}
```python
righe = data["scorpori"]
if righe:
r = righe[-1]
lordo = float(r["lordo"])
aliquota = float(r["aliquotaB"])
netto = lordo * 100 / (100 + aliquota)
iva = lordo - netto
print(f"Net: € {netto:.2f}")
print(f"VAT: € {iva:.2f}")
```
:::
:::table{path="scorpori" headers="Gross,Rate %" deletable="true" editform="fb"}
€ {lordo} | {aliquotaB}
:::
A plain arithmetic calculation, not tax advice: for reduced rates, special
schemes or edge cases (reverse charge, split payment, mixed-rate invoices)
always check with an accountant or your local tax authority's guidance.