I'm trying to build a vechichle vin number decoder, and having a hard time figuring out where to start with it. I've built quite a few php apps for my site, but this one is killing me. It needs to take the vin number when the person puts in on my site and decode it. what it would do is break down the number and tell the person what their car cam with as far as engine, paint, interior, where it was built and other various info as needed, I would like it to be linked to my databse. You can find the php web page here that has what I've been working on http://hp-car.com/vin-decoder

David C. Atkin

http://hp-car.com

    I've no idea what the format of vins are, but I guess the easiest way would be to take the form variable and split it up into its constituent parts using substr etc. then lookup these values in your database.

    hth, njm

      Like a search engine, since I alraedy have a php search that I've written for the site. But in thinking about it I don't think that would work this would kind of be the idea behind it. This is the basic idea of what a vin is 1N19G9J100001.

      Decoding The Chevrolet Camaro VIN
      Early Years 1967-1971
      Location- 1967 only- is a stainless steel plate riveted inside drivers door
      - all others- plate on drivers side dash panel near windshield

             Digit Position                    Represents
            ------------------                    -------------
                 #1---------------------Manufacturer-1= Chevrolet
      
                 #2-------------------Series- 2= Camaro 
      
                 #3-------------------Engine-3= 6 cylinder
                                                        -4= V8
                                                        -5= 6 cylinder
                                                        -6= V8
      
                 #4&#5-----------------Body Type-37= Sport Coupe
                                                                -67= Convertible
                                                                -87= Sport Coupe 
      
                 #6-----------------------Model Year-last digit-7=1967, 8=1968,9=1969
                                                                               -0=1970, 1=1970 
      
                 #7-----------------------Assembly Plant-L= Van Nuys, California
                                                                       -N= Norwood, Ohio 
      
                 #8-#12------------------Sequential Production Number-starting-100001

                          *Model Years 1972- 1980
                             -------------------------------- 
      
               #1------------------------Manufacturer- 1= Chevrolet
      
               #2------------------------Series- S= Type LT
                                                           - S= Berlinetta
                                                           - Q= Sport Coupe 
      
              #3 & #4----------------Body-87-Sport Coupe
      
              #5------------------------Engine-D=250       F=307    H=350 or 305
                                                              -K=350    L=350    U=396 or 305
                                                              -T=350    Q=305    G=305
                                                              -K=229(V6) J=267(V8)  A=231(V6) 
      
              #6-------------------------Year (last digit) 2=1972, 3=1973, 4=1974
                                                            5-1975, 6=1976, 7=1977, 8=1978,
                                                            9= 1979, A=1980 
      
              #7--------------------------Assembly Plant-L= Van Nuys, CA
                                                                           -N= Norwood, OH 
      
              #8-#13---------------------Sequential Production Number-
                                                              (starts with 100001) 

                       *Model Years  1981-1987                       
                     ------------------------------------------ 
      
                   #1--------------------------Country- 1=US , 2=Canada 
      
                   #2--------------------------Manufacturer-G=General Motors 
      
                   #3--------------------------Manufacturing Division-1=Chevrolet 
      
                   #4--(1981-1984)---------Restraint System-A=Non passive
                                                                              -B=Automatic belts
                                                                              -C=Inflatable
                   #4--(1985-1987)----------Carline - F= F Body 
      
                   #5--------------------------Series-P=Sport Coupe/Z28
                                                               -S=Berlinetta 
      
                   #6 & 7----------------------Body-87=Sport Coupe 
      
                   #8--------------------------Engine- A=231(V6)    H=305(V8)
                                                       J=267(V8)    K=229(V6)     L=350
                                                       1=173(V6)    2=151(4C)     7=305
                                                       F=151(4cyl)  H=305           S=305
                                                       G=305          F=305           8=350(2bl)
                                                       S=173(V6) 
      
                    #9--------------------------Check Digit 
      
                   #10-------------------------Year-B=1981, C=1982, D=1983, E=1984
                                                               -F=1985, G=1986, H=1987
      
                   #11-------------------------Assembly Plant-L=Van Nuys, CA
                                                                                 -N=Norwood, OH 
      
                  #12 - #17--------------------Sequential Production Number
                                                          (starting with 100001)

                       *Model Years 1988-1992
                         ------------------------------- 
      
                  #1--------------------------Country- 1= U.S., 2= Canada 
      
                  #2---------------------------Manufacturer-G= General Motors 
      
                  #3---------------------------Manufacturing Division-1= Chevrolet
      
                  #4---------------------------Carline Code-F= F-Body 
      
                  #5---------------------------Model-P= Camaro 
      
                  #6---------------------------Body Style-2= Hatchback/Coupe
                                                                         -3= Convertible 
      
                 #7---------------------------Restraint System-1 & 2=Manual Belts
                                                                                  -3= Manual (inflat-driver)
                                                                                  -4= Automatic Belts 
      
                 #8---------------------------Engine-T=191(V6)      E=305 (V8)
                                                                  -F=305(V8)     S=173 (V6)
                                                                    -8=350
                 #9---------------------------Check Digit 
      
               #10-------------------------Year-J=1988  K=1989  L=1990
                                                                  -M=1991    N=1992 
      
               #11-------------------------Assembly Plant-L= Van Nuys, CA 
      
               #12 - #17-----------------Sequential Production Number

      Chevrolet - Cowl Tag


      The Cowl Tag/Trim Tag/Body Number Tag as it has been referred
      to on the car identified when the car was built, body style, type of seats, colors,
      engine, transmission, rear axle, where made or assembled, when other specific
      info. (perhaps-accessory codes). These provided a wealth of information which
      can provide originality of colour, accessories, etc which important to collectors
      to determine matching engines or to see if car has matching exterior and
      and interior colours. The originality of the car can make the car value greater.

      Click Here for more Vehicle Identification Number information.

      or Return to the VIN Library

        Okay, so look at this for parsing the VIN's into an array:
        http://cz.php.net/manual/en/function.str-split.php

        I had to deal with something like this, where basically you're taking a human system of categorization and putting it into PHP. Try not looking at things in terms of PHP, but more generally as a problem of organization and logic.

        This is a "boiling" process, that is, boiling things down. Try to find common denominators.

        Your first level of organization appears to be year ranges (1972- 1980, 1981-1987, etc.). Create code that parses the VIN into a hashed array based on the identifying characteristics. This becomes your "common" VIN:

        $vin["manufacturer"] = "Chevrolet";
        $vin["engine"] = 6;
        $vin["assemblyPlant"] = " Van Nuys";
        $vin["year"] = 1972;

        Boil, boil, boil, as much as you can given exceptions. Then you can do interesting things.

        Hope that helps.

          you need to break down the manufactures like this :

          1st digit - GM Division
          1 = Chevrolet
          2 = Pontiac
          3 = Oldsmobile
          4 = Buick

          Vin Number Decoding & General Info
          The VIN is the Vehicle Identification number.
          The VIN Number breakdown for specific year Camaros is located under each year Camaro information as the information contained in the VIN changes from year to year. The VIN on the 1967 Camaro is on a stainless steel plate rivited inside the drivers door jamb. All other models have the VIN located on a plate visible through the windshield on the drivers side dash panel.
          VIN info from 1967 - 1971 were in the same format. The breakdown is as follows:
          1st digit: GM Line number: Chevrolet = 1.
          2nd digit: Series number: Camaro = 2
          3rd digit: Model/Engine number:
          3 = 6-cylinder (1967-69 with standard interior) , 4 = V8 (1967-69 with standard interior)
          5 = 6 cylinder (1967 - 69 with custom interior) , 6 = V8 (1967 - 69 with custom interior)
          4th & 5th digit: Body Type Number:
          37 = Sport Coupe (1967-69) 67 = Convertible (1967-69) 87 = Sport Coupe (1970-71)
          6th digit: Last digit of model year:
          7 = 1967, 8 = 1968, 9 = 1969, 0 = 1970, 1 = 1971
          7th digit: Letter indicating assembly plant
          L = Van Nuys, California, N = Norwood, Ohio
          8th through 12th digits: Sequential production number starting with 100001.

          The format for 1972 to 1980 VIN's is as follows:
          1st digit: GM line number, Chevrolet = 1.
          2nd digit: Series number:
          Q = Sport Coupe, S = Type LT (1973 - 78), S = Berlinetta (1979 - 80)
          3rd and 4th digits: Body type: 87 = Sport Coupe.
          5th digit: Engine Code: See specific year (camaro info) for breakdown.
          6th digit: Last digit of model year. i.e. 3 = 1973.
          7th digit: Letter indicating assembly plant
          L = Van Nuys, California, N = Norwood, Ohio
          8th through 13th digits: Sequential production number starting with 100001.

          This is where I lose it.

          <?php
          //First letter in the vin is the Division.
          $vin["1"] = "Chevrolet";
          $vin["2"] = "Pontiac";
          $vin["3"] = " Olsmobile";
          $vin["4"] = "Buick";

          //Second and third possition in the vin is The series for Oldsmobile only.
          //$series
          $seires["31"] = "F85 L6 (1968-71), Cutlass L6 Hardtop Coupe (1971)";
          $series["32"] = "F85 V8 (1968-71), Cutlass V8 Hardtop Coupe (1971)";
          $series["33"] = "F85 Standard V6 or L6 (1965-67)";
          ?>

          Heres a start of some code for it, would this work.

            I'm not getting where you're losing it, though.
            You're collecting make, model, and year from the user, right? (according to your page). So with that information we can safely assume if they say "1976", for example, then the 3rd and 4th characters of the VIN identify the body type. Is this correct?
            Can you post some more specific examples, including VINs? Don't stress - this isn't a trivial problem you're dealing with.

            -t

              I try to figure out how to desipher the different divisions and like such. Yes i do collect that info from the user.

              This is a vin # 1N19G9J100001

              I only need to decode from 1967 - 1973 vin codes, are you by any chance a muscle cars person.

              i will try to get some more vins, but they are hard to come by.

                Write a Reply...