VIN (Vehicle Identification Number) Regular Expression

Category: Numbers

A Vehicle Identification Number, also known as VIN or Chassis Number, is the vehicle identification number chosen and issued by a manufacturer. It usually contains the make, model, designation of the vehicle, and serial number. The VIN is placed on all motor vehicles and boats and is mostly required for the registration of vehicles in most countries.

A Vehicle Identification (VIN) is 17 characters long, composed of: a 1 to 4 character manufacturer code, a 1 to 5 character country code, a 6- characters vehicle category code, 3 numbers that represent the production year, and 2 check digits at most.

In this article, we’ve shared a regular expression that can be used to check if a given string represents a valid Vehicle Identification Number (VIN). Enjoy.

/[A-HJ-NPR-Z0-9]{17}/i

Matches:

  • JH4KA3240LC800239
  • 1G2JB12F047226515
  • 4T1SV21E1MU396756

Non-matches:

  • JH4KA3240LC80023
  • 1G2JB12F-047226515
  • 4T1SV21E1MU396756Z

See Also:

Rate This Regex
Sending
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.