Free tool · no sign-up

Market basket analysis calculator: which dishes are really ordered together

Enter your orders, or paste them, and see which dishes really go together. Market basket analysis scores every pair with Agrawal, Imieliński and Swami’s support and confidence (1993), and with lift, so a drink that is in almost every order doesn’t pass for a pairing.

  • No email
  • Paste straight from a spreadsheet
  • Nothing leaves your browser

Your orders

Example figures · The Walnut Kitchen, 575 orders
Share of orders15.7%
Share of orders8.7%
Share of orders7.8%
Share of orders7.0%
Share of orders7.0%
Share of orders6.1%
Share of orders5.2%
Share of orders5.2%

Or paste from a spreadsheet

Copy the columns from Excel or Google Sheets. A header row is read or skipped; the same order pasted twice is added up.

Results: all orders

Orders analysed
575
Different items
13
Items per order
2.4
Pairs ordered together
22
Pairs bought together
9
Bought together9
Lift above 1 · both minimums metGarlic bread → Margherita pizza, Margherita pizza → Garlic bread, Pasta carbonara → Garlic bread, Milkshake → Cheeseburger, Milkshake → Fries, Cheeseburger → Fries, and 3 morePut them side by side: a combo, a “goes well with” line on the menu, or staff suggesting B when someone orders A.
Only looks strong2
Both minimums met · lift 1 or belowFries → Soft drink, Cheeseburger → Soft drinkB is in so many orders that it turns up with A anyway. A deal on the pair would mostly discount sales you already get.
Rare but linked6
Lift above 1 · support below the minimumGrilled salmon → Caesar salad, Cheesecake → Pasta carbonara, Onion rings → Cheeseburger, Onion rings → Soft drink, Sirloin steak → Fries, Caesar salad → Soft drinkA real link, in few orders. Try a suggestion before changing the menu, and look again with more weeks of orders.
Not a rule27
Confidence below the minimum, or no lift and little supportGrilled salmon → Cheesecake, Cheesecake → Grilled salmon, Caesar salad → Grilled salmon, Onion rings → Sirloin steak, Sirloin steak → Onion rings, Pasta carbonara → Cheesecake, and 21 moreNothing to build on yet.
Every pair, strongest firstSupport = share of all orders · confidence = share of A’s orders · lift above 1 = more often than chance
If an order has (A)It also has (B)Orders with bothSupportConfidenceLiftGroup
Garlic breadMargherita pizza7012.2%66.7%2.95Bought together
Margherita pizzaGarlic bread7012.2%53.8%2.95Bought together
Pasta carbonaraGarlic bread356.1%50.0%2.74Bought together
MilkshakeCheeseburger407.0%100.0%2.67Bought together
MilkshakeFries407.0%100.0%2.23Bought together
CheeseburgerFries18031.3%83.7%1.87Bought together
FriesCheeseburger18031.3%69.8%1.87Bought together
Chicken wingsSoft drink6511.3%100.0%1.55Bought together
Margherita pizzaSoft drink10518.3%80.8%1.25Bought together
FriesSoft drink15026.1%58.1%0.90Only looks strong
CheeseburgerSoft drink12521.7%58.1%0.90Only looks strong
Grilled salmonCaesar salad122.1%60.0%9.32Rare but linked
CheesecakePasta carbonara152.6%65.2%5.36Rare but linked
Onion ringsCheeseburger152.6%60.0%1.60Rare but linked
Onion ringsSoft drink254.3%100.0%1.55Rare but linked
Sirloin steakFries183.1%64.3%1.43Rare but linked
Caesar saladSoft drink254.3%67.6%1.04Rare but linked
Grilled salmonCheesecake81.4%40.0%10.00Not a rule
CheesecakeGrilled salmon81.4%34.8%10.00Not a rule
Caesar saladGrilled salmon122.1%32.4%9.32Not a rule
Onion ringsSirloin steak101.7%40.0%8.21Not a rule
Sirloin steakOnion rings101.7%35.7%8.21Not a rule
Pasta carbonaraCheesecake152.6%21.4%5.36Not a rule
Garlic breadPasta carbonara356.1%33.3%2.74Not a rule
CheeseburgerMilkshake407.0%18.6%2.67Not a rule
FriesMilkshake407.0%15.5%2.23Not a rule
CheeseburgerOnion rings152.6%7.0%1.60Not a rule
Soft drinkChicken wings6511.3%17.5%1.55Not a rule
Soft drinkOnion rings254.3%6.7%1.55Not a rule
FriesSirloin steak183.1%7.0%1.43Not a rule
Chicken wingsMargherita pizza203.5%30.8%1.36Not a rule
Margherita pizzaChicken wings203.5%15.4%1.36Not a rule
Soft drinkMargherita pizza10518.3%28.2%1.25Not a rule
Soft drinkCaesar salad254.3%6.7%1.04Not a rule
Chicken wingsFries305.2%46.2%1.03Not a rule
FriesChicken wings305.2%11.6%1.03Not a rule
Soft drinkFries15026.1%40.3%0.90Not a rule
Soft drinkCheeseburger12521.7%33.6%0.90Not a rule
Garlic breadSoft drink457.8%42.9%0.66Not a rule
Soft drinkGarlic bread457.8%12.1%0.66Not a rule
Sirloin steakSoft drink101.7%35.7%0.55Not a rule
Soft drinkSirloin steak101.7%2.7%0.55Not a rule
Pasta carbonaraSoft drink203.5%28.6%0.44Not a rule
Soft drinkPasta carbonara203.5%5.4%0.44Not a rule

In WalnutPOS

WalnutPOS Insights flags the plainest gap for youInsights reads your paid orders from the last 14 business days and tells you when most orders come without a side or a drink, with a button to create a combo. It works by category, not by pairs of dishes, and doesn’t work out support, confidence or lift; it also can’t export order lines for this calculator yet. It needs 7 trading days and 100 paid orders, and the £0 plan shows one insight in full.

£0 plan: 1 location · holds 10 recipes · reports show the last 24 hours · other limits apply. This calculator has no limits and needs no sign-up. See pricing

Start free

Method

How each pair is scored

N = orders counted
support(A → B) = orders with A and B ÷ N
confidence(A → B) = orders with A and B ÷ orders with A
lift(A → B) = confidence(A → B) ÷ (orders with B ÷ N)
= orders with A and B × N ÷ (orders with A × orders with B)
a rule passes: support ≥ minimum support and confidence ≥ minimum confidence
lift above 1: B is in A’s orders more often than in orders overall

Method: Agrawal, R., Imieliński, T. and Swami, A. (1993), “Mining association rules between sets of items in large databases”, Proceedings of the 1993 ACM SIGMOD International Conference on Management of Data, 207–216, doi:10.1145/170035.170072, for support, confidence and the two minimums. Lift (which they call interest): Brin, S., Motwani, R., Ullman, J. D. and Tsur, S. (1997), “Dynamic itemset counting and implication rules for market basket data”, SIGMOD Record 26(2), 255–264, doi:10.1145/253260.253325. The worked example is from Han, J., Kamber, M. and Pei, J. (2012), Data Mining: Concepts and Techniques, 3rd edn, Morgan Kaufmann, chapter 6. On menus: Ting, Pan and Chou (2010), “Finding ideal menu items assortments: an empirical application of market basket analysis”, Cornell Hospitality Quarterly.

Each rule here has one item on each side (A → B), worked out both ways for every pair ordered together at least once. An item counts once per order, however many of it were in the order. Every comparison is exact; each figure is rounded once, for display. The four groups are this calculator’s, not the papers’: the papers give the measures and the two minimums, not names for what falls short of them.

By Tahseen Dar, founder · Last updated

What to do

What to do with each kind of pair

  • Bought togetherMake the pairing easy: a set price for the two, B printed next to A on the menu, or staff offering B with A. Then check the lift again in a month: a good pairing holds.
  • Only looks strongLeave it alone. B sells with everything, so a deal on A and B mostly gives money off orders that would have had B anyway. Look for what A lifts instead.
  • Rare but linkedTest it cheaply: suggest B to the next people who order A for a week or two. Few orders rest on it, so one busy table can make or break it.
  • Not a ruleNo evidence either way yet. If you expected a pairing here, try a lower minimum confidence, or a longer stretch of orders.

About the method

What this method is

Rakesh Agrawal, Tomasz Imieliński and Arun Swami set out association rules in 1993, for shops that wanted to know what their customers bought together. A rule reads “if an order has A, it also has B”, written A → B, and comes with two measures.

Support is the share of all orders that have both A and B: how much of your trade the rule rests on. Confidence is the share of A’s orders that also have B: how often the rule holds. A rule counts when both reach the minimums you set.

Lift, added by Brin, Motwani, Ullman and Tsur in 1997, compares that confidence with how common B is anyway. Above 1, B turns up with A more than with orders in general; at 1 or below, A tells you nothing about B, however high the confidence.

Reading the results

How to read it

In the example, 83.7% of cheeseburger orders have fries, against 44.9% of all orders: lift 1.87, bought together. 58.1% of cheeseburger orders have a soft drink, but 64.7% of all orders do: lift 0.90, so the pairing only looks strong.

A → B and B → A share their support and lift but not their confidence: most cheesecake orders have pasta carbonara (65.2%), but few carbonara orders have cheesecake.

Support tells you how many orders a rule rests on. Cheesecake → pasta carbonara has a lift of 5.36 but only 15 orders behind it (2.6%), so it is rare but linked: worth a test, not a new menu.

The minimums are yours to set. Lower them for a short list of orders, raise them when you have thousands; the groups move, the measures don’t.

Compared

How it differs from a best-sellers list

Compared onMarket basket analysisA best-sellers list
Looks atWhich items are in the same orderHow many of each item sold
AnswersWhat to pair, bundle or suggestWhat sells most
Popular itemsLift allows for them: a drink in most orders isn’t a pairingAlways at the top
NeedsEach order’s itemsItem totals

Han, Kamber and Pei’s own example: of 10,000 transactions, 6,000 include computer games, 7,500 videos and 4,000 both. Games → videos has 40% support and 66.7% confidence, yet its lift is 0.89: people who buy games buy videos less often than everyone else. Counting sales alone can’t show that; lift can.

Worked example

The textbook’s nine transactions, pair by pair

Table 6.1 of Han, Kamber and Pei (Data Mining: Concepts and Techniques, 3rd edn, 2012, chapter 6): nine transactions of five items, I1 to I5, with the book’s minimum support of 2 transactions (22%) and a minimum confidence of 70%. The transactions: {I1, I2, I5}, {I2, I4}, {I2, I3}, {I1, I2, I4}, {I1, I3}, {I2, I3}, {I1, I3}, {I1, I2, I3, I5}, {I1, I2, I3}.

If it has (A)It also has (B)BothSupportConfidenceLiftResult
I5I1222.2%100.0%1.50Bought together
I4I2222.2%100.0%1.29Bought together
I5I2222.2%100.0%1.29Bought together
I1I5222.2%33.3%1.50Not a rule
I2I4222.2%28.6%1.29Not a rule
I2I5222.2%28.6%1.29Not a rule
I1I3444.4%66.7%1.00Not a rule
I3I1444.4%66.7%1.00Not a rule
I1I2444.4%66.7%0.86Not a rule
I3I2444.4%66.7%0.86Not a rule
I2I1444.4%57.1%0.86Not a rule
I2I3444.4%57.1%0.86Not a rule
I4I1111.1%50.0%0.75Not a rule
I5I3111.1%50.0%0.75Not a rule
I1I4111.1%16.7%0.75Not a rule
I3I5111.1%16.7%0.75Not a rule

Three rules pass, all with lift above 1: I5 → I1 (lift 1.50), I4 → I2 and I5 → I2 (1.29). Each rests on 2 of the 9 transactions, and every transaction with I4 or I5 also has the item on the right.

I1 and I2 are together most often (4 of 9 transactions), but only 66.7% of I1’s transactions have I2, under the 70% bar, and I2 → I1 is 57.1%. The book goes on to rules with two items on one side, such as {I1, I5} → I2; this calculator stops at one item each side, which is where a menu’s pairings sit.

Questions

Market basket analysis, answered

What do I type for each order?

The items in it, separated by commas, and how many orders were exactly like it (leave it blank for 1). You can also paste one line per item with its order number, from a till or delivery-app export, and the calculator puts each order together.

What minimums should I use?

There is no right figure. The example uses 5% support and 50% confidence. With a few hundred orders, lower support finds more pairs but more of them are chance; with thousands, you can raise both. Watch the lift either way.

Why isn’t a drink with everything “bought together”?

Because it would be in those orders anyway. Lift compares how often B comes with A with how often B comes at all. A drink in two orders out of three needs to be in more than two-thirds of A’s orders to show lift above 1.

Is A → B the same as B → A?

They share support and lift, but not confidence. Most cheesecake orders in the example have carbonara, but few carbonara orders have cheesecake, so suggesting cheesecake to carbonara eaters is a weaker bet than the other way round.

Does it look at three items together?

Not here. Each rule has one item on each side, which is where menu pairings sit. The original method also finds rules such as {burger, fries} → milkshake, which need many more orders to be worth trusting.

Is anything I type saved?

No. Everything is worked out in your browser and nothing is sent to us. Download the CSV to keep the results, or use "Copy link": your orders go in the link itself, and we don't store them.

Get these numbers from your real orders

WalnutPOS records every order and every kitchen ticket as you trade, and the customers you add to them. Start on the £0 plan, or WhatsApp us and we'll help.

£0 plan: 1 location · reports show the last 24 hours · other limits apply. See every limit