PHPackages                             tox82/vatnumber-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. tox82/vatnumber-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

tox82/vatnumber-validator
=========================

A simple VAT identification number validator, without any dependencies, NOT relying on the VIES service.

v1.2.2(2y ago)160GPL-3.0-or-laterPHPPHP &gt;=7.0.0

Since Jan 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ToX82/VatNumberValidator)[ Packagist](https://packagist.org/packages/tox82/vatnumber-validator)[ RSS](/packages/tox82-vatnumber-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

VAT validator
=============

[](#vat-validator)

A formal VAT number validator
-----------------------------

[](#a-formal-vat-number-validator)

It's not a full validation tool, it just checks that the VAT number is formally valid: eg. 11 chars, digits only, etc. It's built using these rules:

-
- [https://en.wikipedia.org/wiki/VAT\_identification\_number](https://en.wikipedia.org/wiki/VAT_identification_number)

It requires PHP &gt;= 7.0.

Installation:

```
composer require tox82/vatnumber-validator
```

Usage
-----

[](#usage)

Just load the VatNumber class and execute a check, passing the country code and VAT code as parameters, and it will return a boolean value. True for valid VAT number, false for invalid.

```
use Tox82\VatNumber;

...

echo VatNumber::check('FR', '12345678901'); // true
echo VatNumber::check('HU', '12345678'); // true
echo VatNumber::check('PT', '123456789'); // true
echo VatNumber::check('SE', '123456789012'); // true

echo VatNumber::check('AT', 'U123456780'); // false because of invalid number's length
echo VatNumber::check('MK', 'AA4032013544513'); // false because of  invalid characters
```

TODO
----

[](#todo)

Add specific, more robust validation for each country, when available. Eg. check digits. prefixes, suffixes, etc.

Resources
---------

[](#resources)

- [Report issues](https://github.com/ToX82/VatNumberValidator/issues)
- [Send Pull Requests](https://github.com/ToX82/VatNumberValidator/pulls)
- [Check the main repository](https://github.com/ToX82/VatNumberValidator)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~93 days

Recently: every ~140 days

Total

7

Last Release

1014d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c5693ca56618fba49dba25112105abb77764c3ad57106fa310babbdffa34ad97?d=identicon)[ToX82](/maintainers/ToX82)

---

Top Contributors

[![ToX82](https://avatars.githubusercontent.com/u/659492?v=4)](https://github.com/ToX82 "ToX82 (15 commits)")

---

Tags

validatorvalidationvatvat-validatorvat numberTVAeu vatvalidate eu vatvalidate vat numbervat number validatortva number

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tox82-vatnumber-validator/health.svg)

```
[![Health](https://phpackages.com/badges/tox82-vatnumber-validator/health.svg)](https://phpackages.com/packages/tox82-vatnumber-validator)
```

###  Alternatives

[ph-7/eu-vat-validator

A simple and clean PHP class that validates EU VAT numbers against the central ec.europa.eu database (using the official europa API).

95464.2k1](/packages/ph-7-eu-vat-validator)[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M383](/packages/respect-validation)[opis/json-schema

Json Schema Validator for PHP

64236.9M186](/packages/opis-json-schema)[vlucas/valitron

Simple, elegant, stand-alone validation library with NO dependencies

1.6k4.4M128](/packages/vlucas-valitron)[intervention/validation

Additional validation rules for the Laravel framework

6826.7M8](/packages/intervention-validation)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
