Australian Tax File Number Generator (TFN)

Updated Tool Available

There’s now an easier to access version of this tool available at the following link: Australian Tax File Number (TFN) Generator

Along with a few other widgets that have been added more recently:

Original Post

Sample Australian Tax File Numbers/Test Australian Tax File Numbers:

865414088 459599230 125486619
656077298 796801997 754601340
243494429 953615761 551953801
946489031 996506823 615315318
412042562 907974668 565051603

I came across an old VB Script used to generate random TFNs for testing. I’ve just done up a quick JavaScript bookmarklet to replace it. Just drag the button on the page below to your bookmarks bar and you’ll be able to generate random TFNs.

Get the generator: TFN Generator

A bookmarklet to generate random TFNs

A bookmarklet to generate random TFNs

For info on how it all works, checkout the Wikipedia page: Australian Tax File Number

UPDATE:
If you’re using IE, right click on the link and press add to favourites. Once you’ve added it, click the link in your favourites sidebar. The generator will appear in the top right hand corner of the page.

Let me know if you have any trouble. If you’d like to a custom or corporate copy please contact me.

21 thoughts on “Australian Tax File Number Generator (TFN)

    1. Chris Owens Post author

      Hey Anna,

      Not currently, but I might have a look if I get a bit of time. The formula seems pretty similar:

      http://www.ird.govt.nz/resources/b/9/b9369180451ef8e19355bb7747109566/rwt-nrwt-spec-2011-v1.pdf

      A modulus 11 digit check of currently-held employee IRD numbers should be done to ensure that
      all numbers are valid.
      If an invalid number is found, it should be changed to 000000000 with a tax code of ND (no
      notification).
      The employee should then be asked to provide the correct IRD number. Employees can verify
      their IRD number from their IR card or any correspondence that the employee has received from
      us.
      The IRD number format used by Inland Revenue is a nine digit number, where the IRD number
      has only eight digits a leading 0 (zero) will be used.
      Check digit validation
      The following steps are to be performed:
      • Valid range >10,000,000 & <150,000,000 (This will ensure invalid numbers that will not
      be issued for another 10 years cannot be used in error)
      • To each of the base number’s nine digits a weight factor is assigned. From left to right
      these are: 3, 2, 7, 6, 5, 4, 3, 2.
      • Where the base number is eight digits remember there is a leading zero.
      • Sum together the products of the weight factors and their associated digits.
      • Divide the sum by 11. If the remainder is 0 then the check digit is 0.
      • If the remainder is not 0 then subtract this number from 11, giving the check digit (0 – 9
      are valid).
      • If the resulting check digit is 10, use a secondary set of weight factors and apply steps 2
      and 3 to the same input base number. From left to right the factors for an eight digit
      base number are: 7, 4, 3, 2, 5, 2, 7, 6.
      • Remember there is a leading zero for a eight digit base number. If the new check digit is
      again 10 then the IRD number is invalid (0 – 9 is valid).
      • Compare the calculated check digit with the check digit on the IRD number. If they
      match then the IRD number is valid.
      Example 1
      IR number 49091850. The base number is 49091850 and the supplied check digit is 0. The
      number is greater than 10,000,000. Using the weightings above:
      (0*3) + 4*2) + (9*7) + (0*6) + (9*5) + (1*4) + (8*3) + (5*2) = 154.
      154 / 11 = 14 remainder 0 (i.e. mod(154,11) = 0)
      The remainder (0) = check digit (0), so no further calculation is necessary
      Example 2
      IR number 35901981. The base number is 3590198 and the supplied check digit is 1. The number
      is greater than 10,000,000. Using the weightings above:
      (0*3) + 3*2) + (5*7) + (9*6) + (0*5) + (1*4) + (9*3) + (8*2) = 142.
      142 / 11 = 12 remainder 10 (i.e. mod(142,11) = 10)
      11 – 10 = 1 which matches the check digit.
      The number is valid.
      Example 3
      IR number 49098576. The base number is 4909857 and the supplied check digit is 6. The number
      is greater than 10,000,000. Using the weightings above:
      (0*3) + (4*2) + (9*7) + (0*6) + (9*5) + (8*4) + (5*3) + (7*2) = 177 .
      177 / 11 = 16 remainder 1 (i.e. mod(177,11) = 1)
      IR Electronic Filing
      12
      11 – 1 = 10 so perform the secondary calculation.
      (0*7) + (4*4) + (9*3) + (0*2) + (9*5) + (8*2) + (5*7) + (7*6) = 181
      181 / 11 = 16 remainder 5 (i.e. mod(181,11) = 5)
      11 – 5 = 6 which matches the check digit.
      The number is valid.
      Example 4 (9 digit IRD number)
      IR number 136410132. The base number is 13641013 and the supplied check digit is 2. The
      number is greater than 10,000,000. Using the weightings above:
      (1*3) + (3*2) + (6*7) + (4*6) + (1*5) + (0*4) + (1*3) + (3*2) = 89 .
      89 / 11 = 8 remainder 1 (i.e. mod(89,11) = 1)
      11 – 1 = 10 so perform the secondary calculation.
      (1*7) + (3*4) + (6*3) + (4*2) + (1*5) + (0*2) + (1*7) + (3*6) = 75
      75 / 11 = 6 remainder 9 (i.e. mod(75,11) = 9)
      11 – 9 = 2 which matches the check digit.
      The number is valid.
      Example 5 (9 digit IRD number)
      IR number 136410133. The base number is 13641013 and the supplied check digit is 3. The
      number is greater than 10,000,000. Using the weightings above:
      (1*3) + (3*2) + (6*7) + (4*6) + (1*5) + (0*4) + (1*3) + (3*2) = 89 .
      89 / 11 = 8 remainder 1 (i.e. mod(89,11) = 1)
      11 – 1 = 10 so perform the secondary calculation.
      (1*7) + (3*4) + (6*3) + (4*2) + (1*5) + (0*2) + (1*7) + (3*6) = 75
      75 / 11 = 6 remainder 9 (i.e. mod(75,11) = 9)
      11 – 9 = 2 which does not match the check digit (3).
      The number is invalid.
      Example 6
      IR number 9125568. The number is less than 10,000,000 so fails the first validation.
      The number is invalid.

      Like

      Reply
  1. Anonymous

    Hi Chris, the generator is really useful for development team working in finance or insurance industry. Have you consider to open source the implementation somewhere like github so that people could utilize it better?

    Anyway, nice job and thanks for sharing!

    Like

    Reply
  2. Kim

    Chris. You’re wonderful for sharing this. Thank you so much. Extremely useful especially where you have applications that validate TFNs. Awesome work.

    Like

    Reply
  3. Chris Owens Post author

    Sorry this stopped working for a while – had moved to a new host and didn’t realise that they’d stripped all of the code. It’s back up now so please let me know if you have any issues.

    Cheers,
    Chris

    Like

    Reply
    1. Chris Owens Post author

      Hi Walter,

      I’m a little tied up for the next few weeks sorry mate. If I get a few hours spare after that I’ll see if I can put something together for you!

      Cheers,
      Chris

      Like

      Reply
  4. Pingback: Unable to parse parameter: azuredeploy.parameters.dev.json – Azure Bicep | What I Broke – JavaScript, C#, AWS and General Development

  5. adelaidetech

    One thing that seems to be missing when searching google for TFN generators is something that generates invalid numbers. For demo systems and some testing it would be good to be able to generate TFNs that look OK but fail the validation (so you know they aren’t real by accident).

    Like

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s