Short answer
Build a product import CSV where each variant is its own row under the product's handle, with the option names on the first row and an option value on every row, then import it in Shopify. The free Shopify variant generator on this site makes every combination, unique SKUs and prices for you and checks the file before you download it.
Free tools for this
How variants work in the CSV
Each product has one first row with its title, description, vendor and tags, plus its first variant. Every other variant is another row with the same handle and its own option values, SKU, price and stock. The option names, like Size and Colour, go on the first row only.
Options and combinations
Two options of 4 sizes and 3 colours make 12 variants. Add a third option and the number multiplies. Keep it to the options shoppers really choose between, because very large numbers of variants can slow a theme and confuse buyers.
Try it now: Shopify Variant Generator → · Shopify Product CSV Checker →
Prices that change by size
Many products cost more in larger sizes. In the variant generator add a surcharge after the value, like XL:+100. Every XL variant then costs 100 more, and the compare-at price moves with it.
SKUs that do not repeat
A SKU pattern built from the handle and the option values, like COTTON-SHIRT-M-BLUE, gives every variant a unique SKU. Duplicate SKUs break stock sync and order matching.
Stock, weight and barcodes
Set a starting stock, the weight in grams (used for shipping rates) and, if you have them, real barcodes. A first barcode that counts up is only for items you actually own the numbers for. Do not invent barcodes.
Import and check
Import a small batch first and open the products to check the options, prices and stock. Run the final file through a CSV checker to catch duplicate variants and bad values before they reach your store.