Guide ยท Manufacturing & provisioning
How to generate serial numbers for manufactured products
What makes a serial-number scheme safe for production inventory rather than just a random string: structure, a check digit, guaranteed uniqueness, and a fixed link to the unit's MAC address.
A serial number for a manufactured product is not a random string. It is an identifier that has to stay unique across every unit of that product ever built, survive being typed by a support agent, and tie back to the rest of what you know about the unit, starting with its MAC address. This guide covers what a production-grade scheme contains and why a "random serial number generator" is the wrong tool.
Structure: prefix, date, sequence, check digit
A workable scheme is a fixed template, defined once and reused for every unit on a line:
| Segment | Purpose | Example |
|---|---|---|
| Prefix | Fixed literal. Carries a product or model identifier and, if you want, a site code. | GW- |
| Date code | Year plus ISO week, or a full date. Lets you find "everything built that week" without a database. | 2637 (2026, ISO week 37) |
| Sequence | Zero-padded running counter, wide enough for lifetime volume with margin. | 000042 |
| Check digit | A single Luhn digit over the numeric part, so a transposed or mistyped serial fails instead of matching another unit. | trailing 7 |
In the allocation tool here, a serial scheme is exactly this: an optional literal prefix, an optional date token (year + ISO week, or YYYYMMDD), a zero-padded sequence of a width you choose, and an optional trailing Luhn check digit computed over the date and sequence digits. There is no separate model or SKU field in the scheme; put a model identifier in the prefix, and track SKU in your own inventory columns.
Sequential and alphanumeric formats
The sequence itself is decimal and zero-padded so serials sort and align. Alphanumeric prefixes are fine and common (a model code, a revision letter); keep the running part numeric so the check digit and any barcode symbology stay simple. Avoid ambiguous characters in anything a human reads back: no O/0 or I/1 collisions in the prefix.
Date and ISO-week codes
An ISO-week code (YYWW) is compact and unambiguous once you know it is ISO 8601 week numbering, where the first week of a year is the one containing its first Thursday. A full YYYYMMDD is longer but needs no explanation. Every unit in one batch renders the same date code, taken from when the batch was generated, so a run is not split across a week boundary by accident.
Zero-padded sequences
Fix the width up front. Six digits is one million units; eight is a hundred million. Too narrow and you run out; too wide wastes label space and scanner time. The counter never resets on a date change: it advances for the life of the scheme so no two units ever share a sequence value.
Luhn check digits
The Luhn algorithm (the same checksum credit-card numbers use) turns a mistyped serial into an invalid one instead of a valid one that points at a different unit. It catches every single-digit error and almost every adjacent transposition, for the cost of one extra character. It is not security; it is a typo filter for warranty and RMA desks. Because the check digit depends on all the digits before it, consecutive serials do not have consecutive check digits. Sequence values 0, 1 and 2 under a GW- prefix, 2637 week code and six-digit width render as:
GW-26370000007
GW-26370000015
GW-26370000023
Uniqueness across product lines
Two lines using "prefix + week + sequence" with the same prefix will eventually emit the same serial. Prevent it structurally: a distinct prefix per line, or a separate scheme per line each with its own independent counter. Never rely on the two lines happening not to overlap in time.
Linking serial numbers with MAC addresses
Generate the serial range and the MAC range for a run in one reservation. Then every unit's serial and MAC are bound at that moment and the mapping is in the export; nothing pairs them up later on the line where they could be swapped. See how to allocate MAC addresses during manufacturing.
CSV, Excel, barcode and QR workflows
The export is CSV, which opens directly in Excel, Google Sheets or Numbers. The labelling station generates a Code 128 barcode or a QR code from the serial column; the check digit rides along inside the serial string, so a bad scan or a bad manual entry both fail the same validation. Keep the CSV as the record of the run.
Why random text generators are insufficient
A random-string generator gives you uniqueness only probabilistically, no structure to query by, no check digit, no counter you can audit for gaps, and no connection to the unit's MAC address. For production inventory you want the opposite of random: a deterministic scheme where the next value is knowable, every value is accounted for, and a typo is caught.
To define a scheme and bind it to MAC allocation, see MAC address allocation and the step-by-step guide.
More guides