Zero Dependencies
No bloat. No lodash. No moment.js. Just pure, optimized validation logic that keeps your bundle tiny.
Lightweight, typed, and easy-to-use library for validating tax IDs across multiple countries.
Get up and running in seconds
npm install validator-tax-idimport {
validateDNI,
validateSIREN,
validateNIF,
validateSteuerIdNr,
} from "validator-tax-id";
// 🇪🇸 Spain
validateDNI("12345678Z"); // ✅ true
// 🇫🇷 France
validateSIREN("443061841"); // ✅ true
// 🇵🇹 Portugal
validateNIF("123456789"); // ✅ true
// 🇩🇪 Germany
validateSteuerIdNr("86095742719"); // ✅ trueSelect a country to view specific validation rules and documents.
Missing a country? Request it on GitHub →
See how we compare to other solutions
| Feature | validator-tax-id | Regex Only | Heavy Libraries |
|---|---|---|---|
| Real checksum validation | ✅ | ❌ | ✅ |
| Zero dependencies | ✅ | ✅ | ❌ |
| TypeScript support | ✅ | ❌ | ⚠️ |
| Tree-shakeable | ✅ | - | ❌ |
| Bundle size | <4KB | ~0KB | 50KB+ |
| Individual validators | ✅ | ❌ | ❌ |
Start using Tax ID Validator in your project today. Zero config, instant results.
If this library saved you time, consider buying me a coffee. Your support helps maintain and improve this project!
Donate via PayPal