How the Russia ндс (vat) calculator is verified

Inputs

InputFieldType
Amount (RUB)amountnumber
Directiondirectionstring
What is being suppliedcategorystring
No VAT charged by you: 0% export or similar operation, or the buyer accounts for the taxreverseChargeboolean
Business on the simplified tax system (УСН)simplifiedRegimeboolean
Income for the previous year (RUB) — УСН onlypriorYearTurnovernumber

The formula

Each derived value below is computed by the Valem engine from the expression shown, in this order. Nothing else runs — there is no hidden code path.

Derived valueFieldFormula (JSONata)
Rate for the categoryratecategory = 'reduced' ? $const.reducedRate : $const.standardRate
Rate appliedeffectiveRatereverseCharge ? 0 : rate
NetnetAmountdirection = 'remove' ? $round(amount / (1 + effectiveRate), 2) : $round(amount, 2)
НДСvatAmount$round(netAmount * effectiveRate, 2)
GrossgrossAmount$round(netAmount + vatAmount, 2)
Must charge VATmustRegister$not(simplifiedRegime) or priorYearTurnover > $const.usnExemptionLimit

Rates and thresholds

The expressions above read these as $const. They are the figures the annual refresh replaces, so they live as data rather than being written into the formulas — which is what makes a year-on-year change a one-line diff instead of an edit to arithmetic.

ConstantValue
standardRate0.22
reducedRate0.1
usnExemptionLimit20000000

Test vectors (5)

Every case is executed against this model on each build, by the Java engine and independently by a JavaScript one. A mismatch of a single cent fails the build, so the page cannot ship advertising a figure the model no longer produces.

Case 1 — R1 10,000 RUB net at 22%

given amount10000
given directionadd
given categorystandard
given reverseChargeno
given simplifiedRegimeno
given priorYearTurnover0
expect vatAmount2200
expect grossAmount12200
expect netAmount10000

Case 2 — R2 12,200 RUB gross back to net

given amount12200
given directionremove
given categorystandard
given reverseChargeno
given simplifiedRegimeno
given priorYearTurnover0
expect netAmount10000
expect vatAmount2200

Case 3 — R3 food at 10%

given amount10000
given directionadd
given categoryreduced
given reverseChargeno
given simplifiedRegimeno
given priorYearTurnover0
expect vatAmount1000
expect grossAmount11000

Case 4 — R4 a УСН business with exactly 20 million of 2025 income is exempt

given amount0
given directionadd
given categorystandard
given reverseChargeno
given simplifiedRegimeyes
given priorYearTurnover20000000
expect mustRegisterfalse

Case 5 — R5 above it, VAT applies

given amount0
given directionadd
given categorystandard
given reverseChargeno
given simplifiedRegimeyes
given priorYearTurnover20000001
expect mustRegistertrue

Sources

Check it yourself — and reuse it

The whole model as JSON — inputs, outputs, formulas, vectors and sources in one re-runnable document.

This model is published under CC BY 4.0: use it, adapt it, build on it, with attribution. The licence covers the model — the expression of each rule and the arrangement of the catalog. The rates and thresholds are law, and nobody licenses those; the sources above are where they come from.

← Back to the Russia ндс (vat) calculator

Built with Valem — a live, verifiable calculator you can fork and embed.