PHPackages                             loophp/tin - 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. loophp/tin

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

loophp/tin
==========

Provide validation tools for Taxpayer Identification Number

1.1.1(2y ago)1384.6k↓20.1%7[9 PRs](https://github.com/loophp/tin/pulls)MITPHPPHP &gt;= 8.1

Since Mar 20Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/loophp/tin)[ Packagist](https://packagist.org/packages/loophp/tin)[ Docs](https://github.com/loophp/tin)[ GitHub Sponsors](https://github.com/drupol)[ RSS](/packages/loophp-tin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (6)Versions (18)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/f8254380d65e9867583b1efe35fdbc5e1fbd6c27c2adf6ca754d5cdbdadefff5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f6f7068702f74696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/tin)[![GitHub stars](https://camo.githubusercontent.com/40e6540ee6e015cf61486fd6312a85a88754acb95e13203beb4e32e0bfeeb733/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6c6f6f7068702f74696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/tin)[![Total Downloads](https://camo.githubusercontent.com/8a3ad23656bca080f8977665b206f65d0eb6e2f0a10d49d178ecc22619d8703c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6f6f7068702f74696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/tin)[![GitHub Workflow Status](https://camo.githubusercontent.com/1b254fc1062841ad7bc1af1715cc16af49c3affca57bca6d3a181a5e17df85b0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6f6f7068702f74696e2f74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/loophp/tin/actions)[![Type Coverage](https://camo.githubusercontent.com/c6ed8033507c03badc8d9dfa8317cd834a107800a7f82a4d96862a84a3ba4682/68747470733a2f2f73686570686572642e6465762f6769746875622f6c6f6f7068702f74696e2f636f7665726167652e737667)](https://shepherd.dev/github/loophp/tin)[![License](https://camo.githubusercontent.com/16aa872c28a93960768f4e91971e645135a216ca6f1770ba98ec1d14a704fdb7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6f6f7068702f74696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/tin)

Taxpayer Identification Number (TIN) Validator
==============================================

[](#taxpayer-identification-number-tin-validator)

Description
-----------

[](#description)

A library to validate TIN numbers for individuals. This is based on a Java library, this is why the code does not reflect best practices in PHP (yet).

Supported countries:

- Austria (AT)
- Belgium (BE)
- Bulgaria (BG)
- Croatia (HR)
- Cyprus (CY)
- Czech Republic (CZ)
- Denmark (DK)
- Estonia (EE)
- Finland (FI)
- France (FR)
- Germany (DE)
- Greece (GR) - only size
- Hungary (HU)
- Ireland (IE)
- Italy (IT)
- Latvia (LV) - no check digit
- Lithuania (LT)
- Luxembourg (LU)
- Malta (MT) - no check digit
- Netherlands (NL)
- Poland (PL)
- Portugal (PT)
- Romania (RO) - no check digit
- Slovakia (SK)
- Slovenia (SI)
- [Spain (ES)](docs/TIN-Country_Sheet_ES.md)
- Sweden (SE)
- United Kingdom (UK) - only structure

If your country is not there, feel free to open an issue with your country code, and a link to the specification. Ideally, you can provide a pull request with the algorithm and the tests.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1

Usage &amp; API
---------------

[](#usage--api)

To simply check the validity of a TIN number:

```
