Validate Australian Tax File Numbers (TFN) using official checksum algorithm
0/9 digits entered
What is a Tax File Number (TFN)?
A Tax File Number is a unique 9-digit identifier issued by the Australian Taxation Office (ATO) to individuals and organisations for tax and superannuation purposes.
How does TFN validation work?
The TFN uses a weighted checksum algorithm. Each of the 9 digits is multiplied by a specific weight (1, 4, 3, 7, 5, 8, 6, 9, 10), and the sum must be divisible by 11 for the TFN to be valid.
Use cases for this validator:
TFN (Tax File Number) validator checks if an Australian Tax File Number has a valid structure and checksum. It uses the official ATO checksum algorithm to verify the mathematical validity of a TFN. This tool is essential for Australian developers building payroll systems, tax software, and superannuation applications that need to validate TFN input.
The validator applies the ATO weighted checksum algorithm: each of the 9 digits is multiplied by a specific weight (1, 4, 3, 7, 5, 8, 6, 9, 10), the products are summed, and the result must be exactly divisible by 11 (remainder = 0) for the TFN to be structurally valid.
TFN validation algorithm: (d1×1 + d2×4 + d3×3 + d4×7 + d5×5 + d6×8 + d7×6 + d8×9 + d9×10) mod 11 = 0. Format must be exactly 9 digits. This validates structure only - not whether the TFN is actually issued or belongs to a real person.
Validate TFN format in employee onboarding forms before submission.
Verify TFN data integrity in payroll databases and HR systems.
Validate TFN parameters in tax-related API endpoints.
Check multiple TFNs when importing employee data from spreadsheets.
// TFN checksum validation
const TFN_WEIGHTS = [1, 4, 3, 7, 5, 8, 6, 9, 10];
function validateTFN(tfn) {
// Clean input - remove spaces and non-digits
const cleaned = String(tfn).replace(/\D/g, '');
// Must be exactly 9 digits
if (cleaned.length !== 9) {
return { valid: false, error: 'TFN must be exactly 9 digits' };
}
// Convert to array of numbers
const digits = cleaned.split('').map(Number);
// Calculate weighted sum
const sum = digits.reduce((acc, digit, i) => {
return acc + (digit * TFN_WEIGHTS[i]);
}, 0);
// Check if divisible by 11
const isValid = sum % 11 === 0;
return {
valid: isValid,
formatted: cleaned.replace(/(\d{3})(\d{3})(\d{3})/, '$1 $2 $3'),
checksum: sum,
remainder: sum % 11
};
}
// Usage examples
console.log(validateTFN('123 456 782')); // Check specific TFN
console.log(validateTFN('987654321')); // Without spacesComplete TFN validation with detailed result including checksum calculation.
Use when validating user input in Australian tax, payroll, or superannuation systems. Essential for form validation, data quality checks, and API input sanitization. Always combine with server-side validation for production systems.
No. Validation only checks the mathematical structure. A TFN that passes validation may not be issued by the ATO. Real verification requires ATO integration.