How to retrieve TAC from IMEI?

16,996

Solution 1

Read 8 digits from beginning. TACs with 6 digits are rarely and are in the past (since 2004).

But for safety you can analyze it twice, and begin from longest version, then use short. If you find phone model, then you use that TAC. If not, then use 8 digits, because old phones are well known (in most cases).

To transform tac to phone model use databases:

Solution 2

The first eight digits of the IMEI number is the TAC code. Prior to 2004, the first six digits were the actual device identifier and the next two were a Final Assembly Code (FAC)representing where the device was manufactured. Since then, the FAC portion has been dropped.

TAC codes are issued by two authorities (CTIA for North America and the GSM Association for everywhere else), identifiable by the first two digits. Because the TAC codes are issued sequentially, you can test positions three through six to identify the six-digit TAC codes. For example, I use code like this:

if    substr(IMEI,1,2) = '01' and substr(IMEI,1,8) < '01015900'  /* CTIA */
   or substr(IMEI,1,2) = '35' and substr(IMEI,1,8) < '35150100'  /* GSMA */
   then TAC_TYPE = '6-digit';
   else TAC_TYPE = '8-digit';

These ranges were determined by my personal inspection of the TAC code tables and are not guaranteed.

See this Wikipedia link for more info.

Share:
16,996
Przemysław Różycki
Author by

Przemysław Różycki

IT Architect with experience in Java technologies

Updated on June 08, 2022

Comments

  • Przemysław Różycki
    Przemysław Różycki almost 2 years

    The problem is simple. I have an IMEI and I want to retrieve a TAC from it. How can I do it? Is there a way of recognizing how many digits should TAC have if I have just an IMEI? Is it necessary to know explicitly the year of production of the device to know it?

  • Przemysław Różycki
    Przemysław Różycki over 11 years
    Thanks for a piece of code, but this is my main concern - how can I recognize the TAC type (6 or 8 digits).
  • Przemysław Różycki
    Przemysław Różycki over 11 years
    My main concern is how to recognize the TAC type - 6 or 8 digits. According to you, it's necessary to refer to device database to do this. Thanks.