vat validator

Validate a VAT number

Options

Using with form field

The HTML attributes are used to set the validator options via the Declarative plugin

Name HTML attribute Type Description
country* data-fv-vat___country String or Function An ISO-3166 country code
message data-fv-vat___message String The error message

The validator supports the following countries (click the sample number to validate it):

# Country Abbreviation VAT system Country code Sample VAT Is it valid?
1 Argentina - AR 20267565392
2 Austria UID AT U13585627
3 Belgium n° TVA / BTW-nr / Mwst-nr BE 0428759497
4 Brazil CNPJ BR 16.727.230.0001-98
5 Bulgaria ДДС номер BG 7552A10004
6 Croatia PDV-ID; OIB HR 33392005962
7 Cyprus ΦΠΑ CY 10259033Z
8 Czech Republic DIČ CZ 25123890
9 Denmark CVR DK 13585628
10 Estonia KMKR EE 100931558
11 Finland ALV nro FI 20774741
12 France n° TVA FR 4Z123456782
13 Germany USt-IdNr. DE 136695976
14 Greece ΑΦΜ GR 023456780
15 Hungary ANUM HU 12892312
16 Iceland VSK IS 111111
17 Ireland VAT no IE 6433435OA
18 Italy P.IVA IT 00743110157
19 Latvia PVN LV 16137519997
20 Lithuania PVM kodas LT 100004801610
21 Luxembourg No. TVA LU 15027442
22 Malta Vat No. MT 11679112
23 Netherlands Btw-nr. NL 123456789B90
24 Norway Orgnr NO 988077918
25 Poland NIP PL 8567346215
26 Portugal NIF / NIPC PT 501964843
27 Romania CIF RO 18547290
28 Russia ИНН RU 781300557475
29 Serbia PIB RS 101134702
30 Slovakia IČ DPH SK 2022749618
31 Slovenia ID za DDV SI 50223055
32 South Africa - ZA 0123456789
33 Spain NIF / CIF ES B78640570
34 Sweden Momsnr. SE 123456789101
35 Switzerland MWST / TVA / IVA CH E107787577IVA
36 United Kingdom VAT Reg No GB 802311781
37 Venezuela RIF VE J000126518

Using with ES6 module

Basic Example

You can click on sample from the table above to see if it's a valid or invalid VAT.

ES6 Module Example

The following snippet shows how to use the vat validator with ES6 module:

More examples

Changelog

  • v1.7.0: Support new format of Dutch VAT number
  • v1.6.0: Fixed an issue that the country option isn't passed to the placeholder message

Related validators

The following validators might be useful to you.