Random VIN Generator by Year and Brand: Test Data and Check Digits
- Authors

- Name
- Geeks Kai
- @KaiGeeks

A generator creates synthetic, VIN-shaped test data using a selected manufacturer prefix, year-code convention and calculated check digit. It is useful for form validation, imports, demos and automated tests. A passing check digit does not prove that a manufacturer issued the identifier, that a vehicle exists, or that the remaining attributes match that brand and year.
Open the Geekskai Random VIN Generator for sample generation and TXT, CSV or JSON export. Treat its output and decoded metadata as test fixtures. The current year selector covers 2010–2030; it does not cover every historical or future model year, and its displayed year is not an authoritative vehicle record.
This guide uses U.S. VIN rules where specified. It is not a certification that a generated identifier complies with every ISO requirement or every market’s rules.
If the application needs a manufacturer-confirmed model, trim or plant, random generation is insufficient. Use an authorized real sample and the manufacturer’s decoding information, then distinguish it from synthetic parser-test data.
NHTSA’s overview describes the 17-character identifier and links to its public vPIC decoder. 49 CFR 565.13 requires manufacturer assignment, permitted characters and the ninth-position check digit for vehicles covered by the U.S. regulation.
| Position | What to test | Limit of the test |
|---|---|---|
| 1–3 | Manufacturer/type identifier for high-volume manufacturers | A plausible prefix alone does not validate the rest of the VIN. |
| 4–8 | Manufacturer-defined vehicle descriptors | Random characters do not necessarily describe a valid model or body configuration. |
| 9 | U.S. check digit | Confirms a mathematical relationship, not a real vehicle identity. |
| 10 | Model-year code | Codes recur; context is needed to resolve the year. |
| 11 | Plant code | Meaning depends on manufacturer decoding information. |
| 12–17 | Remaining identifier section | Low-volume manufacturers use part of this section for manufacturer identification. |
The allowed U.S. character set excludes I, O and Q. The content requirements in 49 CFR 565.15 also distinguish high- and low-volume manufacturers. For low-volume manufacturers, positions 12–14 participate in the manufacturer identifier; do not reduce every manufacturer lookup to the first three characters.
| Year | Code | Year | Code | Year | Code |
|---|---|---|---|---|---|
| 2010 | A | 2017 | H | 2024 | R |
| 2011 | B | 2018 | J | 2025 | S |
| 2012 | C | 2019 | K | 2026 | T |
| 2013 | D | 2020 | L | 2027 | V |
| 2014 | E | 2021 | M | 2028 | W |
| 2015 | F | 2022 | N | 2029 | X |
| 2016 | G | 2023 | P | 2030 | Y |
This range is a convenience for test generation, not the complete coding cycle. Position 10 alone is ambiguous across the recurring 30-year sequence. For passenger cars, and multipurpose passenger vehicles and trucks up to 10,000 lb GVWR, the note to Table VII in §565.15 uses position 7 to distinguish 1980–2009 from 2010–2039: numeric versus alphabetic, respectively. Do not apply that vehicle-class-specific rule indiscriminately to every VIN.
A generator can place the desired character in position 10 without constructing a fully consistent descriptor section. If your test needs the full U.S. model-year distinction, independently inspect position 7 and the manufacturer’s descriptor rules rather than trusting the tool’s displayed year label.
The calculation transliterates letters, multiplies by position weights and takes the sum modulo 11; a remainder of 10 is represented by X. The ninth position has weight zero. The following example checks only the permitted character set, length and check digit:
const VIN_CHARACTERS = /^[A-HJ-NPR-Z0-9]{17}$/
const VIN_WEIGHTS = [8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2]
const VIN_LETTER_VALUES = {
A: 1, B: 2, C: 3, D: 4, E: 5, F: 6, G: 7, H: 8,
J: 1, K: 2, L: 3, M: 4, N: 5, P: 7, R: 9,
S: 2, T: 3, U: 4, V: 5, W: 6, X: 7, Y: 8, Z: 9,
}
// This checks the U.S. check digit, not manufacturer assignment or vehicle existence.
function hasValidVinCheckDigit(vin) {
if (typeof vin !== "string" || !VIN_CHARACTERS.test(vin)) {
return false
}
const weightedSum = Array.from(vin).reduce((sum, character, index) => {
const numericValue = VIN_LETTER_VALUES[character] ?? Number(character)
return sum + numericValue * VIN_WEIGHTS[index]
}, 0)
const remainder = weightedSum % 11
const expectedDigit = remainder === 10 ? "X" : String(remainder)
return vin[8] === expectedDigit
}
console.log(hasValidVinCheckDigit("1M8GDM9AXKP042788")) // true
console.log(hasValidVinCheckDigit("1M8GDM9A0KP042788")) // false
console.log(hasValidVinCheckDigit("INVALID")) // false
Run this in a JavaScript environment such as Node.js. The first two examples differ only at the check digit. A successful result is not a full VIN validator: it does not validate manufacturer assignments, descriptor combinations, model-year context, or whether the identifier belongs to an actual vehicle.
For parser tests, keep both positive and negative cases: wrong length, forbidden characters, an intentionally changed check digit, and a year-code/descriptor mismatch. Test your application’s error handling as well as acceptance of a checksum-valid string.
A brand can have multiple identifiers across vehicle types and regions. A short static prefix table can mislead readers into treating one prefix as proof of every model in a brand’s catalog.
Use the manufacturer-submitted information exposed through NHTSA vPIC when decoding real vehicle data. NHTSA explains that decoder information is supplied by manufacturers. Record warnings and unknown fields rather than interpreting any partial result as confirmation that a generated VIN is genuine.
Keep an explicit synthetic-data marker in the surrounding fixture or dataset. A random generator cannot guarantee that a value never coincides with a real identifier, so isolation is more reliable than assuming “random” means non-real.
No. It verifies a checksum relationship. Manufacturer assignment and real-vehicle identity require different evidence.
No. The generator’s selector maps a limited range to codes. An authoritative interpretation may need vehicle-class rules, descriptor context and manufacturer data.
Use synthetic values only in clearly separated testing or demonstration workflows. Registration, title, insurance and other real-vehicle processes require confirmed vehicle records.
No. This is a practical test-data guide with cited U.S. rules. A 17-character string with a passing check digit is not a certification of full compliance.
For quick synthetic fixtures, use the VIN generator. For a real record, start with the actual vehicle’s identifier and an authoritative source rather than a random replacement.