Tax id validate
tax-id-validate · version 1.0.0 · Identifiers & check digits · free, no key needed
Validate a taxpayer/business registration number’s format and, where defined, checksum for one of 12 national schemes.
Use when you need to: validate a tax id number · check a brazilian cpf check digit · validate a 2026 alphanumeric cnpj.
Decide before calling
Read the versioned contract and the supported scope below. Reuse tax-id-validate@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use tax-id-validate@1.0.0 for validate a tax id number. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- validate a tax id number
- check a brazilian cpf check digit
- validate a 2026 alphanumeric cnpj
- check digit for an australian business number
- validate a chilean rut with the k check character
- is this a valid us ein format
- check a new zealand ird number
- בדיקת מספר חברה ברשם החברות
Not supported
- a registry lookup to confirm the business or taxpayer actually exists
- the Mexican RFC homoclave check character (not publicly specified; format and birth-date only)
- a taxpayer scheme not in the 12-value enum (VAT numbers are eu-vat-id-validate)
Behavior
- value must be a non-empty string of at most 14 UTF-8 bytes (limit_exceeded if longer, checked before anything else); scheme must be one of the 12 enum values. Every other problem is {valid:false, reason} rather than thrown, same reason precedence as national-id-validate: wrong_length, invalid_character, invalid_component, checksum_mismatch.
- il-company: exactly 9 digits (no padding), must begin with 5 (the Corporations Authority prefix, which distinguishes it from a personal Teudat Zehut), standard Luhn over the 9 digits. br-cpf: 11 digits, not 11 repeated digits, two weighted mod-11 check digits (weights [10..2] then [11..2]).
- br-cnpj: 14 characters, a 12-character body (digit or A-Z, char value = code point - 48, so digits are 0-9 and letters 17-42) plus 2 check digits, weighted mod-11 (PESOS [6,5,4,3,2,9,8,7,6,5,4,3,2]); the same formula covers the pre-2026 fully-numeric form.
- us-ein: 9 digits, format only (campus-code prefixes are not a public checksum). us-itin: 9 digits starting with 9, group digits (4th-5th) in 70-88, 90-92 or 94-99, format only.
- au-abn: 11 digits, first digit reduced by 1, weights [10,1,3,5,7,9,11,13,15,17,19], sum divisible by 89 (all 11 digits participate, no trailing check digit). au-tfn: 8 or 9 digits, weights [1,4,3,7,5,8,6,9,10] (truncated to length), sum divisible by 11.
- nz-ird: 8 or 9 digits, value read as an integer must be strictly between 10,000,000 and 150,000,000 (invalid_component otherwise); base = every digit except the final check digit, left-padded with 0 to 8 digits; primary weights [3,2,7,6,5,4,3,2] over base; if that gives check value 10, secondary weights [7,4,3,2,5,2,7,6] are tried instead, and check value 10 again means no valid check digit exists.
- in-pan: 10 characters (5 letters, 4 digits, 1 letter); the 4th letter must be one of the 10 defined holder-type codes (P,C,H,F,A,T,B,L,J,G); no published check-digit algorithm for the 10th character. ar-cuit: 11 digits, weights [5,4,3,2,7,6,5,4,3,2]; a remainder of 1 has no valid check digit.
- cl-rut: 2-9 characters, a numeric body (1-8 digits) plus a digit or 'K' check character, cyclic weights [2,3,4,5,6,7] from the rightmost body digit; remainder 0 maps to '0', remainder 1 to 'K'. mx-rfc: 13 characters (4 letters, YYMMDD, 3-character homoclave); month 01-12 and day 01-31 only (SAT’s homoclave algorithm is not publicly specified, so checksum is not_defined).
- Pure integer and table-lookup arithmetic; no locale, clock, or randomness; identical output across runs for the same input.
Input
value(string, required): min length 1; max length 14scheme(one of "il-company", "br-cpf", "br-cnpj", "us-ein", "us-itin", "au-abn", "au-tfn", "nz-ird", "in-pan", "ar-cuit", "cl-rut", "mx-rfc", required)
Output
valid(boolean, required)reason(one of null, "wrong_length", "invalid_character", "invalid_component", "checksum_mismatch", required)scheme(one of "il-company", "br-cpf", "br-cnpj", "us-ein", "us-itin", "au-abn", "au-tfn", "nz-ird", "in-pan", "ar-cuit", "cl-rut", "mx-rfc", required)normalized(string, required): min length 1; max length 14checksum(one of "verified", "not_defined", required)
Limits
- max value bytes: 14
Example
Request input:
{
"value": "11144477735",
"scheme": "br-cpf"
}
Response:
{
"result": {
"valid": true,
"reason": null,
"scheme": "br-cpf",
"normalized": "11144477735",
"checksum": "verified"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "tax-id-validate",
"version": "1.0.0",
"input": {
"value": "11144477735",
"scheme": "br-cpf"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/tax-id-validate/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"value":"11144477735","scheme":"br-cpf"}'
The machine-readable contract is at /v1/tools/tax-id-validate/versions/1.0.0.
CLI
node cli.mjs run tax-id-validate 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- National id validate: Validate a personal identity number’s format and, where defined, checksum for one of 14 national schemes.
- Imo number validate: Validate a 7-digit IMO ship identification number's weighted mod-10 check digit, with or without the 'IMO ' prefix.
- Npi validate: Validate a 10-digit US National Provider Identifier using the Luhn formula with the constant 80840 healthcare prefix.
- Eu vat id validate: Detect the country from an EU/XI VAT id prefix and validate its format and, where defined, national checksum.
- Gs1 key validate: Validate a GTIN-8/12/13/14, GLN, SSCC or GSIN's GS1 mod-10 check digit and look up its 3-digit GS1 prefix meaning.
- Isin validate: Validate a 12-character ISIN's ISO 6166 Luhn check digit and parse its country prefix, NSIN and NSIN scheme.