curatedapi

VAT number check

Check the structure and check digit of a VAT number from any EU member state, Northern Ireland, Great Britain, Switzerland or Norway.

The VAT number, with or without its country prefix. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.
The country, when the number has no prefix. Greece uses EL on VAT numbers. Options: AT: Austria; BE: Belgium; BG: Bulgaria; CY: Cyprus; CZ: Czechia; DE: Germany; DK: Denmark; EE: Estonia; EL: Greece; ES: Spain; FI: Finland; FR: France; HR: Croatia; HU: Hungary; IE: Ireland; IT: Italy; LT: Lithuania; LU: Luxembourg; LV: Latvia; MT: Malta; NL: Netherlands; PL: Poland; PT: Portugal; RO: Romania; SE: Sweden; SI: Slovenia; SK: Slovakia; XI: Northern Ireland; GB: United Kingdom; CHE: Switzerland; NO: Norway; GR: Greece (same as EL); CH: Switzerland (same as CHE)

Examples

Result: A French number with the wrong key

Valid
Whether the VAT number passes every check.
no
Normalized
The number as it was checked: separators removed, letters in upper case.
FR41954506077
Problem
What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.
CHECK_DIGIT
Message
The result in a sentence, naming the rule that failed.
The two-digit key is 41, but the SIREN 954506077 gives 61.
Country
The prefix: the ISO 3166 code, except EL for Greece, XI for Northern Ireland and CHE for Switzerland.
FR
Country name
The country's name.
France
National number
The number after the prefix.
41954506077

Calculator check/vat-number@1.

How it is calculated

the country's structure, then its check digit rule (for example ISO 7064 MOD 11,10 for Germany, modulus 97 for Belgium, Luhn for Italy and Sweden)

Checks a VAT identification number against its country's structure and check digit rule: all 27 EU member states, Northern Ireland (XI), Great Britain, Switzerland and Norway. This is the test to run before sending a number to VIES or putting it on an invoice: it catches typing mistakes at once and works when VIES is down. It does not say whether the number is registered.

  • The number is checked by arithmetic alone. Nothing is looked up, so a valid result means the number is well formed, not that the account, company or security exists.
  • Whether a number is registered for VAT is answered by the EU's VIES service or the national tax office, which are not consulted.
  • In Bulgaria, Czechia, Latvia and Spain a person's VAT number is their personal number; its date part is checked where it has one.
  • The EU prefix (non-Union One Stop Shop numbers) is not covered.

References

Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.

Use it from your code

POST /v1/calc/check/vat-numberVersion 1
curl https://api.curatedapi.com/v1/calc/check/vat-number \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "number": "FR 41 954 506 077"
  }'
The same call in Python
import os

import requests

payload = {
    "number": "FR 41 954 506 077",
}
response = requests.post(
    "https://api.curatedapi.com/v1/calc/check/vat-number",
    headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
    json=payload,
    timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
    "number": "FR 41 954 506 077",
};
const response = await fetch("https://api.curatedapi.com/v1/calc/check/vat-number", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});
console.log((await response.json()).result);

MCP tool calc_check_vat_number at https://mcp.curatedapi.com. Inputs, outputs and errors in the API reference.

Put it on your website

<div data-curatedapi-widget="check/vat-number" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>

Use a public key registered for your site. Calculations are billed like API calls. How widgets work.

Related calculators

Add this calculator to your website

Paste two lines into your page and your visitors get this calculator. Each use counts as one call on your plan, the same as the API.

Free for up to 1,000 uses a month. 50,000 uses a month cost $9.00 on the Starter plan.