Shopify doesn't generate SKUs, but a spreadsheet can. Export the product CSV, add a column that builds each SKU from codes for the product and its options, check for duplicates, then paste the results into the SKU column and import. A formula such as product code, dash, option 1 code, dash, option 2 code gives every variant a readable, consistent SKU in minutes. Apps can do the same inside Shopify if you'd rather not touch a CSV.
The short version
- Export Products > Export (the product CSV).
- Make short codes for products and option values in a lookup table.
- Build SKUs with a formula:
=B2&"-"&C2&"-"&D2. - Check uniqueness with
COUNTIF. Fix any duplicates. - Paste into the SKU column (as values), import, overwrite existing products.
Step 1: Lookup codes
| Name | Code |
|---|---|
| Lavender candle | LAV |
| Coconut candle | COC |
| 8 oz | 08 |
| 16 oz | 16 |
| Amber jar | AMB |
| Frosted jar | FRO |
Short, fixed-length codes sort neatly. Use zero-padded sizes (08, 16) so 8 sorts before 16.
Step 2: The formula
In a helper sheet, with the product handle in column A and option values in B and C:
- Product code:
=VLOOKUP(A2, Codes!A:B, 2, FALSE) - Size code:
=VLOOKUP(B2, Codes!A:B, 2, FALSE) - Jar code:
=VLOOKUP(C2, Codes!A:B, 2, FALSE) - SKU:
="CND-"&D2&"-"&E2&"-"&F2
Result: CND-LAV-08-AMB.
Step 3: Check for duplicates
Next to the SKU column: =COUNTIF(G:G, G2). Anything above 1 is a duplicate. Duplicates break CSV matching and confuse apps that look
products up by SKU.
Step 4: Import
Copy the SKU column and paste as values into the product CSV's SKU column. Format the column as text so codes like 0812 keep their zeros. Import with Overwrite products with matching handles. Check a few products afterwards.
Keeping SKUs consistent later
- Keep the lookup table. New scents and sizes get codes from the same sheet, so the pattern holds.
- Never reuse a retired code. If Coconut is discontinued, COC stays retired; old orders still point to it.
- Write the pattern down in one line at the top of the sheet: product, size, jar.
- Add SKUs when you create products, not months later, so CSVs and purchase orders match from day one.
A made-up example
Mākena Candle Co. has 22 scents in 3 sizes and 2 jars: 132 variants, none with SKUs. With a 30-row lookup table and four formulas, every variant gets a SKU in 15 minutes. One duplicate appears: two scents both coded COC (coconut and cocoa). Cocoa becomes CCA, and the import goes through. Shopify SKU numbers covers choosing a pattern.
Where this stops working
A generator names what you sell. Makers also need codes for materials (wax, wicks, fragrance, jars) and a lot code for each batch, and neither belongs in Shopify's product CSV. A SKU also can't tell two pours of the same scent apart. Shopify lot numbers and Shopify SKU vs barcode cover the other codes.
How TaroStack does it
TaroStack for Shopify runs inside your Shopify admin and keeps your Shopify SKUs matched to your products, adds codes for the materials behind them, and gives every batch its own lot code, printed on GS1-128 labels if you want them. Free for 14 days.
