SKU Generator: Readable Codes for Every Variant

Give the product a short base code, list its attributes such as colour and size with a code for each option, and choose a separator. The generator writes one SKU for every combination, adds an optional sequence number, flags any duplicates and lets you download the list as a CSV to import into your store or spreadsheet.

SKU compared with UPC, EAN and GTIN
CodeWho makes itFormatUsed for
SKUYou, the sellerAny letters and digits you chooseYour own stock tracking and reports
GTIN-12 (UPC)Licensed through GS112 digitsScanning at checkout, mainly North America
GTIN-13 (EAN)Licensed through GS113 digitsScanning at checkout, mainly outside North America
GTIN-8Licensed through GS18 digitsSmall items at checkout
GTIN-14Licensed through GS114 digits, never starts with 0Cases and other groupings of a product

Updated

A SKU (stock keeping unit) is your own name for one exact sellable thing: the medium blue shirt, not just the shirt. Because you invent it, it can carry meaning, so anyone in the stockroom can read TEE-BLU-M and know what to pick. The trick is a consistent pattern, which is what this tool enforces.

Build your SKUs

Base code (product line): TEE

Separator: -

Colour: Blue=BLU, Sage=SAG, Black=BLK

Size: Small=S, Medium=M, Large=L

Add a sequence number

9 SKUs

Generated SKUs
SKUColourSize
TEE-BLU-SBlueSmall
TEE-BLU-MBlueMedium
TEE-BLU-LBlueLarge
TEE-SAG-SSageSmall
TEE-SAG-MSageMedium
TEE-SAG-LSageLarge
TEE-BLK-SBlackSmall
TEE-BLK-MBlackMedium
TEE-BLK-LBlackLarge

Built in your browser; nothing is uploaded.

Generate SKUs in your own script

The same rule in a few lines of JavaScript, for when you import products from a spreadsheet or a supplier file.

Every combination of attribute codes

flatMap builds the combinations one attribute at a time. Run it in your browser console to see the list.

const base = "TEE";
const attrs = [["BLU", "SAG", "BLK"], ["S", "M", "L"]];

const skus = attrs.reduce(
  (combos, codes) => combos.flatMap((c) => codes.map((code) => [...c, code])),
  [[base]],
).map((parts) => parts.join("-"));

console.log(skus); // ["TEE-BLU-S", "TEE-BLU-M", ... 9 SKUs]

A pattern that scales

Decide the parts once and write them down: product line, then each attribute in a fixed order, then an optional number. TEE-BLU-M, TEE-BLU-L and MUG-SAG-12 all follow the same rule, so a new product never needs a meeting.

Fixed-length codes per attribute (three letters for colour, one or two for size) keep SKUs lined up in a list, which makes mistakes easier to spot.

When you also need barcodes

If you sell through other retailers or marketplaces that ask for a UPC or EAN, you need GTINs licensed through GS1 for each variant. Keep a column in your sheet that maps each SKU to its GTIN, then print barcodes from the GTIN, not the SKU.

For your own shelves and bins, you can print a barcode that encodes the SKU itself, because that code is only ever read inside your business.

How it works

  1. Type a base code for the product, for example TEE for a t-shirt line.
  2. For each attribute, enter its options one per line as Name=CODE, such as Blue=BLU. Without a code, the first letters of the name are used.
  3. Pick the separator and decide whether to add a sequence number and how many digits it should have.
  4. Check the table: every combination gets a SKU, and duplicates are highlighted.
  5. Press Download CSV or Copy list to move the SKUs into your store or spreadsheet.

Tips

Frequently asked questions

What is the difference between a SKU and a UPC?

A SKU is an internal code you create for your own inventory, and two shops can give the same item different SKUs. A UPC is a GTIN-12, a 12-digit number licensed through GS1 that identifies the product the same way everywhere. GS1 US sells single GTINs from $30 with no renewal fee, as of October 2026.

Can I use my SKU as a GTIN in Google Merchant Center?

No. Google's gtin attribute takes real GTINs such as UPC, EAN, JAN, ISBN or ITF-14, and its help page says to only provide a GTIN if you are sure it is correct. Put your SKU in the product's own SKU or ID field instead.

Does Shopify need a SKU?

Shopify calls SKUs an optional code that identifies the product within your business and says each SKU needs to be unique for effective tracking. Barcodes are a separate field.

Are the SKUs saved anywhere?

No. They are built in this browser tab. Download the CSV or copy the list before you close the page.

Will the CSV open in Excel or Google Sheets?

Yes. Fields that contain a comma or a double quote are wrapped in double quotes, with inner quotes doubled, following RFC 4180, and lines end with CRLF.

Related: Barcode generator, Product label maker, Packing slip generator, Shopify pricing guide.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Free Tools

We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.

Product

Who It's For

Features

Resources

Company

View Sitemap