All posts

How to Set Prices from Cost on Shopify (Markup vs Margin, Explained)

Set Shopify prices from your cost per item: where to enter costs, the markup vs margin formulas, a spreadsheet method for the whole catalog, rounding, and how to undo it.

Shopify bulk price change form set to raise prices by a percentage with .99 rounding

Most stores set prices by looking at competitors or rounding up from a gut feeling. That works until costs change. A supplier raises a price list, shipping gets more expensive, or a currency moves, and suddenly half the catalog sells at a thinner margin than you think. Pricing from cost fixes that: you decide how much you want to earn on top of what each item costs you, and the price follows.

This guide shows how to set prices from cost on Shopify: where the cost lives, the difference between markup and margin (the most common mistake), how to calculate new prices for the whole catalog for free, when an app saves time, and how to keep the change reversible.

The short answer

Enter each variant's Cost per item in Shopify, choose a markup or a target margin, and calculate the price from it:

  • Markup: price = cost × (1 + markup). Cost 50 with a 40% markup gives a price of 70.
  • Margin: price = cost ÷ (1 − margin). Cost 50 with a 40% margin gives a price of 83.33.

For a whole catalog, export your products to CSV, calculate the new price in a spreadsheet, round it, and import the file back. An app can do the same calculation inside Shopify with a preview and an undo.

Step 1: Make sure every variant has a cost

Shopify stores cost on the variant, in the Cost per item field of the pricing section. Once a cost is entered, the product page in Shopify admin shows the profit and margin next to it, based on the current price. That's a useful quick check, but it only helps if the cost is actually there.

To fill in missing costs:

  1. Go to Products, select the products and click Bulk edit.
  2. Add the Cost per item column if it isn't shown.
  3. Sort or scan for empty cells and type in the costs.
  4. Click Save.

For a large catalog, the product CSV export includes a Cost per item column. You can paste costs from a supplier price list there and import the file. Shopify's Help Center explains the columns in its product CSV guide.

Decide what "cost" means for your store before you start, and use the same definition everywhere. Some merchants enter only the purchase price; others include inbound shipping, duties or packaging. Either works, but mixing them makes your margins impossible to compare.

Step 2: Markup vs margin (the mistake that costs money)

Markup and margin describe the same price from two directions, and they're easy to mix up.

  • Markup is profit as a percentage of cost. Buy at 50, sell at 70: profit is 20, which is a 40% markup.
  • Margin is profit as a percentage of price. Sell at 70 with a cost of 50: profit is 20, which is a 28.6% margin.

So "I want 40%" gives two very different prices depending on which one you mean:

  • Cost 10.00: 14.00 with a 40% markup, 16.67 with a 40% margin.
  • Cost 50.00: 70.00 with a 40% markup, 83.33 with a 40% margin.
  • Cost 120.00: 168.00 with a 40% markup, 200.00 with a 40% margin.

If your accountant or business plan talks about a target gross margin, you need the margin formula. If you think in "cost plus X%", you need the markup formula. To turn a target margin into the markup you'd type into a cost-plus tool, use markup = margin ÷ (1 − margin). A 40% margin is a 66.7% markup; a 50% margin is a 100% markup (doubling the cost).

Keep in mind that Shopify's own margin figure on the product page is margin on price, the second definition.

Step 3: Calculate prices from cost with a CSV file (free)

The CSV route works on any plan and any catalog size, and the original export doubles as your backup.

  1. Export. Go to Products, click Export, choose all products or the current filter, and pick the CSV format for spreadsheet programs.
  2. Keep a copy. Save the untouched file as products-before-cost-pricing.csv. That's your undo.
  3. Add a formula. Open the file in Google Sheets or Excel. In an empty column, calculate the price from the Cost per item column. With cost in column X, use =X2*1.4 for a 40% markup or =X2/(1-0.4) for a 40% margin.
  4. Round. Wrap the formula to get a clean price, for example =CEILING(X2*1.4,1)-0.01 to end in .99.
  5. Skip rows without a cost. Wrap it in =IF(X2="","",...) so empty costs don't become a price of 0. Then make sure those rows keep their old price before you paste anything back.
  6. Paste values. Copy the new column and paste it as values over Variant Price. Delete the helper column.
  7. Import. Go to Products, click Import and tick Overwrite products with matching handles.
  8. Spot-check. Open a few products from different collections and compare them with the spreadsheet.

Two warnings. An overwrite import replaces every column in the file, so remove columns you don't need (keep Handle and the variant columns). And a blank price cell is the fastest way to break a product, which is why step 5 matters.

Different rules for different collections

One markup rarely fits a whole store. Accessories often carry a higher markup than big-ticket items, and products you compete on with marketplaces may need a lower one. A simple approach:

  • Group products by collection, product type or vendor.
  • Pick one markup or margin per group, based on what that group needs to cover (returns, shipping, payment fees, marketing).
  • Apply each group separately, and write the rule down so the next cost update uses the same numbers.

Rounding and price endings

A cost-based price is almost never a nice number: 50 × 1.4 is fine, but 23.17 × 1.4 is 32.438. Pick one rounding rule for the store, such as ending in .99, .90 or a whole number, and apply it in the same step.

Round up, not to the nearest value, when the formula is meant to protect your margin. Rounding 32.44 down to 31.99 quietly gives away part of the markup you just calculated.

What about compare-at prices and Markets?

Pricing from cost changes the selling price, not the compare-at price. If a product is currently on sale, recalculating its price can leave the old compare-at below the new price, and most themes then hide the sale label. Decide per product whether the sale continues (and raise compare-at too) or is over (clear it). Our guide to compare-at prices covers this in detail.

If you sell in other countries, prices converted from your base price follow the change, but fixed prices you set in a market's price list or a B2B catalog don't. Update those separately, or a cost increase will only reach part of your customers.

Using an app: Lilya Bulk Price & Revert

If costs change often or the catalog is large, an app saves you the spreadsheet round trip. Our app, Lilya: Bulk Price & Revert, has a Price from cost action (Basic plan and above). Here's how it works:

  • It calculates price as cost per item × (1 + the percentage you enter). That's the markup formula from Step 2, so a 40% entry on a cost of 50 gives 70. If you're aiming for a target margin, convert it to a markup first (a 40% margin means entering about 66.7%).
  • Variants without a usable cost stay unchanged, so missing costs don't turn into zero prices.
  • You pick the products by collection, tag, vendor, product type or by hand, and choose rounding: no rounding, 2 decimals, .99, .90 or a whole number. A rounded increase won't turn into a decrease.
  • The preview shows the old and new price of every variant before anything is written, with a warning when a market has its own fixed price.
  • The change is saved as a campaign. If you change your mind, revert puts the previous prices back, and variants you edited by hand in the meantime are kept and listed in the report.

Checklist before you reprice from cost

  • Every variant you're repricing has a cost, using the same definition of cost
  • You know whether your target is a markup or a margin, and you've converted if needed
  • One rule per collection or product type, written down
  • One rounding rule, rounding up
  • A full product CSV export saved unchanged
  • A decision on compare-at prices for products on sale
  • Fixed prices in Markets and B2B catalogs checked
  • A test on one collection before the whole store

FAQ

Can Shopify set prices from cost automatically?

Shopify stores cost per item and shows the profit and margin on the product page, but it doesn't recalculate prices when costs change. You can do it with a CSV export and a spreadsheet formula, or with an app that has a price-from-cost rule.

What's the difference between markup and margin?

Markup is profit divided by cost; margin is profit divided by price. A product that costs 50 and sells for 70 has a 40% markup and a 28.6% margin.

How do I convert a target margin into a markup?

Use markup = margin ÷ (1 − margin). A 30% margin is a 42.9% markup, a 40% margin is a 66.7% markup, and a 50% margin is a 100% markup.

What happens to products without a cost?

In a spreadsheet, nothing unless you guard against it: an empty cost can produce a price of 0. Use an IF formula to skip those rows. In Lilya Bulk Price & Revert, variants without a usable cost are left unchanged.