
Due to the start of Model 3 production, Tesla sent a letter to the National Highway Traffic Safety Administration (NHTSA), which makes decoding its vehicle identification numbers (VIN) a piece of cake.
Thanks to Teslarati, we now have the full explanation regarding how to decode the Model 3 VIN, or any Tesla VIN. Yes, you can use the same format to figure out details about the Model S and X. Teslarati reported that a white Tesla Model 3 release candidate's VIN ended in 000316. This was assumed to mean that Tesla has built over 316 release candidates thus far. Tesla's letter to the NHTSA reads (via Teslarati):

“Tesla intends to begin regular production of a new carline, the Model 3, starting July 2017. Model 3 will be released into commerce as a MY2017 vehicle and pursuant to the requirements of § 565.26 Reporting requirements, Tesla Inc. hereby is submitting the updated VIN decoding information for MY2017 vehicles. The submission adds a new vehicle line (Model 3) to its already existing MY2017 vehicles lines (Model S and Model X).”
Every Tesla vehicle has a VIN number beginning with 5YJ. All automakers have their own unique World Manufacturer Identifier (WMI). The fourth digit tells which model it is. So for instance, 5YJ3 is a Model 3 and 5YJS is a Model S. The entire VIN contains a total of 17 digits. Below is the decoder in order of digits:
1-3: WMI as explained above
4: specific model; S, X, 3
5: Body Type and Gross Vehicle Weight Rating (GVWR)
A - hatchback, five door, left-hand drive
C - MPV, five door, left-hand drive, Class E
E - sedan, four door, left-hand drive
6: Vehicle Restraint System
1, A, B, and D - all have various Type 2 manual seat belts with front airbags, PODS, side inflatable restraints, knee airbags
7: Fuel Type
E - electric
8: Motor/Drive Unit
1 - single motor, standard 3 - single motor, performance 2 - dual motor, standard 4 - dual motor, performance A - single motor, standard B - dual motor, standard
9: check digit to be assigned by manufacturer pursuant to 49 CFR § 565.6(c)10: model year
H - 2017
11: assembly plant
F - Fremont, CA
12-17: serial number
Source: Teslarati