All articles
Pricing Strategy

Shopify Formula Pricing: The Complete Guide to Margin-Based Pricing Rules

Learn how to set up formula-based pricing rules on Shopify to hit exact margin targets automatically — across hundreds or thousands of products.

2026-06-049 min readBy BulkOps Team

Most Shopify merchants price products one of two ways: gut feel or a spreadsheet someone built three years ago that nobody fully understands. Both approaches break down the moment your catalog grows past a few dozen SKUs, your costs change, or you try to run a sale across multiple collections.

Formula pricing is the alternative. Instead of setting prices manually, you define rules — "price = cost × 2.5" or "price = cost ÷ (1 - 0.45)" — and apply them across your entire catalog at once. When costs change, you rerun the formula. When you want a category at 40% margin instead of 35%, you update one number.

This guide covers how formula pricing works, how to build rules that protect your margins, and how to apply them at scale without breaking anything.

What Is Formula Pricing?

Formula pricing means calculating your retail price from a mathematical rule based on your cost data, rather than setting it by hand.

The two most common approaches are markup pricing and margin pricing. They sound similar but produce different results.

Markup pricing adds a percentage on top of your cost:

Price = Cost × (1 + markup%)

A 100% markup on a $20 product gives you a $40 retail price — meaning you made $20 gross profit.

Margin pricing targets a specific gross margin percentage:

Price = Cost ÷ (1 - margin%)

A 50% margin on a $20 product gives you a $40 retail price — same number, but the math works differently. At 60% margin, that same $20 product would be priced at $50.

The key difference: markup is calculated from cost, margin is calculated as a percentage of revenue. If your accountant or investor asks "what's your gross margin?", they want the margin number — which means margin-based pricing is usually the cleaner approach for running a business.

Why Static Pricing Breaks Down at Scale

A 50-SKU store can survive with manually-set prices. A 500-SKU store cannot.

Here's what happens without formula pricing:

Margins become inconsistent. Prices get set at different times by different people (or different moods of the same person). Your Lodge cast iron skillet might be at 42% margin. The matching silicone handle might be at 18%. You don't notice until you look at product-level profit data.

Cost changes aren't reflected. Your supplier raises prices 8% in January. You update a few bestsellers but miss 60 products. Six months later, you're selling a third of your catalog below your target margin.

Sales destroy margins on products you forgot. You run a 20% sitewide sale. On products already at 25% margin, that sale puts you at or below breakeven after Shopify fees and shipping.

Formula pricing solves all three by making the relationship between cost and price explicit and repeatable.

Building Your Pricing Formula

Before you write a single rule, you need to know two numbers: your target gross margin and your true cost per item.

What to include in cost per item

Most merchants undercount cost. Your cost per item should include:

  • Product cost from supplier or manufacturer
  • Inbound shipping cost (allocated per unit)
  • Import duties and tariffs (if applicable)
  • Quality inspection or prep costs
It does not need to include Shopify fees, outbound shipping, or marketing — those come out of gross margin, not cost.

A Carhartt heavyweight crewneck might cost $28 from your supplier. Add $2.50 allocated shipping and $0.50 prep cost, and your true cost is $31. That's the number your formula should use.

Setting your target margin

Your target margin depends on your business model, but here are common benchmarks by category:

  • Apparel (DTC): 55–70% gross margin
  • Outdoor/sporting goods: 45–60%
  • Home goods/cookware: 40–55%
  • Accessories: 60–75%
  • Electronics/tech: 25–40%
A good starting point: work backward from your operating expenses. If your overhead runs 30% of revenue and you want 15% operating profit, you need at least 45% gross margin — probably more to cover returns and discounts.

The formula

Once you have those numbers:

Price = Cost ÷ (1 - target_margin)

Examples at 55% margin:

  • $31 cost → Price = $31 ÷ 0.45 = $68.89 (round to $69)
  • $18 cost → Price = $18 ÷ 0.45 = $40.00
  • $52 cost → Price = $52 ÷ 0.45 = $115.56 (round to $115.99)

Setting Up Pricing Rules by Category

One formula rarely fits your entire catalog. Different product categories have different competitive dynamics, different customer price sensitivity, and different margin expectations.

The practical approach: create one formula rule per category or collection, each with its own target margin.

For example, a store selling outdoor gear might set up:

  • Tents & shelters: 48% margin (competitive market, customers price-shop)
  • Apparel: 62% margin (more brand-driven, less price-sensitive)
  • Accessories & add-ons: 68% margin (lower AOV, higher tolerance for margin)
  • Clearance: 25% margin (floor — sell through without going underwater)
This way, when you add 50 new apparel products, you assign them to the apparel rule and they're priced correctly immediately. No manual calculation.

Scenario-Based Pricing Rules

Beyond category rules, you can set up scenario-based rules that apply conditionally based on product attributes.

Common scenarios:

Supplier-specific rules. If Supplier A consistently has higher shipping costs than Supplier B, you might set a slightly higher margin target for their products to maintain net profitability.

Price tier rules. High-ticket items often sell better at a slight margin concession (because the absolute dollar profit is still large). A $400 Yeti cooler might be priced at 45% margin even though your 40% target on other items is 55%.

Vendor rules. If you carry Stanley and Hydro Flask, and one brand commands a premium in your market, the pricing rules can reflect that.

In BulkOps, you set these up under Pricing Rules → scenario_based, where each rule has a filter (by collection, vendor, tag, or product type) and a formula applied to matching products.

Applying Formulas Without Breaking Prices

The biggest risk with formula pricing isn't the math — it's applying changes to the wrong products or overwriting prices you've deliberately set outside the formula.

Before applying any pricing rule at scale:

Filter before you apply. Never run a formula on your full catalog without filters. At minimum, filter by collection or product type to scope the change. A broad formula applied everywhere will reprice your bestsellers, your bundles, and your promotional items all at once.

Check the output before committing. Any good bulk editor will show you a preview of what prices will change to before you save. Scan for outliers — a $3 product about to be priced at $85 usually means a cost data error.

Back up first. If your catalog has 300+ products, take a snapshot before any pricing run. If something goes wrong (a cost field was blank and the formula produced $0 or infinity), you want to be able to revert without rebuilding prices by hand.

Use compare-at price. When you update retail prices, also update your compare-at price if relevant. If you're raising prices, keeping the old price as compare-at can actually help conversion. If you're not using compare-at intentionally, clear it — stale compare-at prices confuse customers and can trigger Shopify policy issues.

Keeping Formulas Current

Formula pricing isn't a one-time setup. It requires maintenance.

Quarterly cost audits. Costs drift. Supplier price changes, shipping rate adjustments, and currency fluctuations all affect your true cost per item. Set a calendar reminder to audit cost data every quarter and rerun your formulas if costs have moved more than 5%.

Margin reviews by category. Once a month, pull a margin report segmented by collection or product type. Look for categories falling below target — it usually means either costs changed or someone manually overrode prices without updating the formula.

Pre-sale checks. Before any promotional sale, run a margin check to see which products will fall below an acceptable floor at the discounted price. A 25% sitewide sale on products at 22% margin is a guaranteed loss.

Formula Pricing in Practice

Here's what this looks like end-to-end for a mid-sized outdoor retailer with 400 SKUs:

  • Cost data is in Shopify for every product variant (imported from their ERP or entered manually).
  • Four pricing rules cover their catalog: apparel, hard goods, accessories, and clearance — each with a target margin and formula.
  • Monthly: they run a cost check, update any products where supplier cost changed, then reapply the relevant formula to get prices back in line.
  • Pre-sale: before any promotion, they preview the discounted margin across all sale items and exclude any products that would go below 15% gross margin.
The result: consistent margins across the catalog, no surprises on the P&L, and pricing that takes about 30 minutes per month instead of a full day.

---

If you're managing a Shopify catalog with more than 50 products and still setting prices manually, formula pricing is one of the highest-leverage changes you can make. BulkOps makes it straightforward — you define the formula, filter to the right products, preview the output, and apply. Try it free and see what your margins actually look like across your catalog.

Shopify formula pricingShopify margin-based pricingShopify pricing rulesShopify bulk pricing formula

Try BulkOps free on your store

Everything covered in this article is built into BulkOps. Free plan for stores up to 50 products — no credit card required.

Add to Shopify — Free

Was this helpful?