Guide
Designing SKU codes: a pattern, short words and a sequence that never repeats
A stock keeping unit, or SKU, is the code you give each product variant in your own system. The same cotton shirt in navy and medium, and in navy and large, are two SKUs. A good scheme makes codes you can read at a glance, never repeats one, and is applied the same way to every product. Writing them by hand drifts quickly, so this page builds them from a pattern, a list of products and a few rules, then checks the result for clashes.
The product list
Type one product per line, with the name, then the category, colour and size, separated by pipes. The last three are optional. The default list has five lines, such as a classic T-shirt in the Apparel category, Navy, size M. The page splits each line and uses the columns to fill the tokens in your pattern.
The pattern
The pattern is text with up to five tokens: {CAT}, {NAME}, {COLOR}, {SIZE} and {SEQ}. Anything else in the pattern, such as hyphens or a prefix, is copied as it is. The default, {CAT}-{NAME}-{COLOR}-{SIZE}-{SEQ}, gives codes like APP-CLA-NAV-M-001. A pattern must contain at least one token. If a column is empty, its token disappears, and the page merges the doubled hyphen and trims separators at the ends.
Shortening words
Names, categories and colours are cleaned of spaces and punctuation and cut to the number of letters you choose, three by default. Two methods are available. Keeping the first letters turns “Classic T-shirt” into CLA. Dropping vowels after the first letter turns “Ceramic mug” into CRM when cut to three, which often stays more recognisable. Sizes are never cut, because “XL” and “350ml” are already short and cutting them would make different products look the same.
The sequence
The sequence token counts up across the list from the first number you choose, padded with zeros to the length you set, so 1 becomes 001. Because it increases for every line, no two codes from one run can clash. If you generate codes in several runs, start each from the number after the last one used, or two runs will produce the same numbers.
A worked example
The default list gives APP-CLA-NAV-M-001, APP-CLA-NAV-L-002, APP-CLA-WHI-M-003, ACC-LEA-BRO-004 and HOM-CER-WHI-350ML-005. The wallet has no size, so its empty token and the extra hyphen are removed. The longest code is 21 characters. The second sample drops the hyphens and the sequence, using the pattern {NAME}{COLOR}{SIZE} with two letters and vowels dropped. It gives CLNVM, CLNVL and CLWHM for the shirts, and CRWH350ML for the mug, still unique, though less readable.
Checking for duplicates
The result lists how many SKUs were made, how many are different, any that appear more than once, and the length of the longest. When duplicates exist, a warning suggests adding the sequence or more letters. In the short sample, two different products that shorten to the same letters and share a colour and size would clash, and the report would name them.
Edge cases
An empty list is rejected, and so is a list of more than 2,000 lines. The letters kept must be from 1 to 12 and the sequence length from 1 to 8. A capital-letters switch converts everything to upper case. Accented letters and symbols in names are dropped when words are shortened, so a name made only of symbols becomes empty.
Limits
Marketplaces and stock systems set their own limits on the length and characters of a SKU, and the page does not know them, so check yours before you print labels or upload a file. It also does not read your existing list, so it cannot warn that a new code matches one you already use.
Related tools
- Barcode Generator turns a SKU into a scannable code.
- Bulk Barcode Sheet Generator prints sheets of labels carrying your SKUs.
- Price Tag and Shelf Label Maker puts the SKU on a tag with the price.
- EAN-13 and UPC Check Digit Calculator checks retail product numbers that sit beside your own codes.
Checked against the current version of the Product SKU Generator on .

