Australian Tax File Number Generator (TFN)

Hey everyone,

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 link below to your bookmarks bar and you’ll be able to generate random TFNs.

Click to Generate (or drag to your bookmarks bar): 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

Sample Australian Tax File Numbers/Test Australian Tax File Numbers:
865414088
459599230
112474082
565051603
907974668

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.

13 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.

      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!

    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.

    Reply

Leave a Reply