NI No Validation

Nigel Light
Nigel Light Contributor
edited December 2023 in General

Hi,

Can somebody please advise on the algorithm used in the NI No (UK) validation step. I am finding some numbers which match the validity rules described here National Insurance number - Wikipedia are being rejected by Experian Aperture

I'll try a trim on the field (in case that makes a difference) and if anybody wants to email me I can provide a few examples.

Thanks Nige

Answers

  • Josh Boxer
    Josh Boxer Administrator
    edited May 2022

    Hi Nigel

    Looking at this article: https://www.gov.uk/hmrc-internal-manuals/national-insurance-manual/nim39110

    Example number: QQ 12 34 56 A (fail as Q not allowed!)

    1. Made up of 2 letters, 6 numbers and a final letter 
    2. Final letter is always A, B, C, or D.
    3. D, F, I, Q, U, and V NOT used as first or second letter
    4. O is not used as the second letter of a prefix
    5. BG, GB, KN, NK, NT, TN and ZZ are not to be used

    Are your valid numbers consistent with any of these rules?

    Rather than 'Trim', if you 'Remove noise' - "the value is transformed retaining only letters or digits. Everything else is removed. "


  • Nigel Light
    Nigel Light Contributor

    Thanks @Josh Boxer - Removing Noise seems to have done the trick (and highlighted the true validity failures eg some beginning NT....)

    Nige