vin
Validates a VIN (Vehicle Identification Number) for USA vehicles.
Options
| Option | Type | Default | Description |
|---|---|---|---|
message | string | locale default | Custom error message |
Playground
Valid values
| Value | Notes |
|---|---|
"1HGBH41JXMN109186" | Valid Honda VIN |
Invalid values
| Value | Reason |
|---|---|
"1HGBH41JXMN109187" | Fails check digit |
"1HGBH41JXMN10918" | Only 16 chars instead of 17 |
Notes
- Empty string (
"") always returnsvalid: true. Combine withnotEmptyto require a value. - VIN is exactly 17 alphanumeric characters. Letters I, O, and Q are not used.
- The 9th character is a check digit validated using a weighted sum algorithm.