{"id":"vat-net-gross-convert","version":"1.0.0","description":"Convert a net or gross amount at a VAT rate into a net, VAT and gross triple that adds up exactly at currency precision.","supported_operations":["add 20% VAT to 100 euros","how much VAT is included in 120 gross at 20 percent","remove VAT from a price including 23% VAT","net to gross calculation with VAT rounding","reverse VAT calculation from a gross total","VAT fraction 1/6 calculator","credit note VAT amount half up rounding","split gross price into net and VAT for a currency"],"unsupported_operations":["looking up the VAT rate of a country or product category","multi-line invoices or several VAT rates at once","reverse charge, exemptions or OSS rules","compound or cascading taxes"],"semantics":["net_to_gross: net = amount, vat = round(net x rate_percent / 100), gross = net + vat. gross_to_net: gross = amount, vat = round(gross x rate_percent / (100 + rate_percent)), net = gross - vat. The rounding is applied once, to the VAT, on the exact rational, so net + vat = gross always holds exactly; net is never derived by a separate division.","Examples: net 100.00 at 20% gives vat 20.00 and gross 120.00; gross 120.00 at 20% gives vat 20.00 (the \"VAT fraction\" 1/6); gross 10.00 at 20% half_even gives vat 1.67 and net 8.33; net 696.22 at 25% half_up gives vat 174.06 (174.055 is a tie); net -7612.50 at 19% half_up gives vat -1446.38.","amount is a signed decimal string (negative for credit notes) and must be a multiple of the minor unit by value (\"12.500\" is fine at scale 2, \"12.505\" is invalid_input, reason excess_precision). rate_percent is a non-negative decimal from 0 to 100 inclusive (above 100 is invalid_input, reason rate_out_of_range); rate 0 gives vat 0 and the output rate_percent is canonical (\"20.00\" gives \"20\").","Exactly one of currency (active ISO 4217 code with a minor unit, case-insensitive) or scale (0..18) is required; unknown, historic and minor-unit-less codes are unsupported_input. rounding is required, with the ten modes half_even, half_up (ties away from zero), half_down, half_ceiling, half_floor, up, down, ceiling, floor and unnecessary (an inexact VAT is not_computable, reason rounding_necessary).","Outputs have exactly scale fraction digits and never \"-0\"; vat has the sign of the amount. Decimal strings over 62 characters are limit_exceeded (before syntax); more than 60 digits or 40 fraction digits is invalid_input.","Data is the pinned ISO 4217 snapshot named by data_version; no clock, locale or network. The tool holds no VAT rates.","Disclaimer: arithmetic calculation only; not financial, tax, legal, or investment advice."],"limits":{"max_decimal_chars":62,"max_decimal_digits":60,"max_fraction_digits":40,"max_scale":18,"max_rate_percent":100},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["amount","direction","rate_percent","rounding"],"properties":{"amount":{"type":"string","minLength":1,"maxLength":62,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Net amount (net_to_gross) or gross amount (gross_to_net); at most the currency/scale precision by value."},"direction":{"type":"string","enum":["net_to_gross","gross_to_net"]},"rate_percent":{"type":"string","minLength":1,"maxLength":62,"pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"VAT rate in percent, 0 to 100 inclusive (20 means 20%)."},"currency":{"type":"string","minLength":3,"maxLength":3,"pattern":"^[A-Za-z]{3}$","description":"Active ISO 4217 alphabetic code with a minor unit (case-insensitive). Give exactly one of currency or scale."},"scale":{"type":"integer","minimum":0,"maximum":18,"description":"Fraction digits for non-ISO units. Give exactly one of currency or scale."},"rounding":{"type":"string","enum":["half_even","half_up","half_down","half_ceiling","half_floor","up","down","ceiling","floor","unnecessary"]}}},"output_schema":{"type":"object","additionalProperties":false,"required":["net","vat","gross","rate_percent","currency","scale","data_version"],"properties":{"net":{"type":"string","minLength":1,"maxLength":400,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Net amount at exactly `scale` fraction digits."},"vat":{"type":"string","minLength":1,"maxLength":400,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"VAT amount, same sign convention as the amount."},"gross":{"type":"string","minLength":1,"maxLength":400,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"net + vat, exact."},"rate_percent":{"type":"string","minLength":1,"maxLength":62,"pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Canonical rate: no trailing fraction zeros (\"20.00\" -> \"20\", \"7.50\" -> \"7.5\")."},"currency":{"type":["string","null"],"pattern":"^[A-Z]{3}$"},"scale":{"type":"integer","minimum":0,"maximum":18},"data_version":{"type":"string","const":"iso4217-datasets-7cdc784-2026-07-27"}}},"examples":[{"input":{"amount":"100.00","direction":"net_to_gross","rate_percent":"20","currency":"EUR","rounding":"half_up"},"output":{"net":"100.00","vat":"20.00","gross":"120.00","rate_percent":"20","currency":"EUR","scale":2,"data_version":"iso4217-datasets-7cdc784-2026-07-27"}},{"input":{"amount":"10.00","direction":"gross_to_net","rate_percent":"20","currency":"GBP","rounding":"half_even"},"output":{"net":"8.33","vat":"1.67","gross":"10.00","rate_percent":"20","currency":"GBP","scale":2,"data_version":"iso4217-datasets-7cdc784-2026-07-27"}},{"input":{"amount":"696.22","direction":"net_to_gross","rate_percent":"25","scale":2,"rounding":"half_up"},"output":{"net":"696.22","vat":"174.06","gross":"870.28","rate_percent":"25","currency":null,"scale":2,"data_version":"iso4217-datasets-7cdc784-2026-07-27"}}],"execute_url":"/v1/tools/vat-net-gross-convert/versions/1.0.0/execute"}