Nim is a really fascinating two player game of strategy where each players take turns removing counters from a single stack of their choice. The player to remove the last counter wins. Sounds very easy game, Right ? Give it a try and see if you can find a strategy to win every time.
Nim Game
- Start with setting up as many stacks of counters as you want and each stack can have as many counters as you like. For example, you start with 3 stacks of counters, the first with 7, the second with 5 and the third with 3.
- Players take turn removing any number of counters from any one of the stack. The player must take at least one counter on their turn.
- The winner is the player who picks up the last counter.
How to Introduce Nim Game to Kids
I wanted to introduce my kids to a basic version of the NIM game and build on their problem-solving skills to find a strategy for solving Nim Game with multiple stacks of counters.
One Stack of Counters

First, set up only one stack of counters and ask your kids if they want to go first or second ? Of course, children always want to go first and win. So hopefully, they will go first and grab all the counters and win. If not, grab all the counters on your turn and you will be the winner. Now set the game up again, and ask them if they will want to go first or second ?
So far, the game is pretty simple but it showed my kids that if they have one stack of counters left on their side, they’re winning.
Two Stacks of Counters
Next, play a simplified version of the two stack Nim game with just one counter in each stack. Ask your kids again if they want to go first or second ? Your kid will be quick to guess that going first is a guaranteed loser ! No matter which counter they choose, you can take the other counter to win.
So, the strategy for two stack Nim game is to get the counters down to a single counter in each stack on your opponent’s turn for you to win.
Now, setup two stacks with two counters in each stack ? Can you figure out the winning strategy for this one ?

The basic idea to winning is to try to make it so your move makes the stacks equal. On your turn, take counters off the bigger stack until both stacks are equal. This way, you compel your opponent to make the stacks unequal on their next turn, and you can evenly balance the stacks again on your turn. So no matter what the other player does, you copy their move and keep the stacks equal. In the end, you will win, because the other player will inevitably have to finish a stack and you can finish the last stack.
For this strategy to work, in order to win, you need to be in a position where you can make the stacks equal. That is, if the stacks start unequally the first player has a winning strategy and the second player otherwise has the winning strategy.
Play the game with two stacks and more counters to see if the strategy always work.
Further Extension
Once you have played the game a couple of times, ask your kids about different strategies to win the NIM game ?
- Can you generalize to have a winning strategy for any number of stack? When is it advantageous to be the first player? Second player?
- How can you win NIM when you are playing with three stacks? Does one of the players have a winning strategy? Which player do you think? Check out the HINT
HINT :
Think of powers of 2 and see if the strategy to match the number of counters in each stack can be applied to the three stacks.
For example,
Let’s start with three stacks of 13, 9 and 7 counters.

13 can be written in terms of power of 2 as (8 + 4 + 1) or

Similarly, 9 can be written as power of 2 as ( 8 + 1 ) or

and 7 can be written as (4 +2 +1 ) or


Since the player A in above example can always match things up, we know that player A will win. Since by working in power of 2 we are sure that there are two set of powers of 2 that match exactly – and those two sets of power of 2 don’t come from the same stack ! We know that the player B can’t take away two of our sets and leave it still matched. Therefore, player A will win in the end if he can keep maintaining to match things up.
Which player has winning strategy depends on whether the stacks come with matching numbers of set of power of 2. If it does, the second player has the winning strategy since the first player must disturb the matching. Otherwise, the first player can make the sets of power of 2 match, and can go on to win.
The game of NIM teaches kids about problem solving. You can also find 30+ Critical thinking puzzles HERE.
- 2025 New Year Math Activity
- Write the Room Activities for Kids: A Creative Learning Adventure
- VALENTINE’s DAY ROLL AND COLOR COUNTING DICE Game
- Can a Heart Shape Tessellate ? VALENTINE’s DAY STEAM ACTIVITY
- DRAGON COORDINATE GRAPHING MYSTERY PICTURE
Pin it for later

Sounds like a great game to play when we go up to WI this weekend. I love games that involve strategy and this one is great because it’s simple materials!
It the first time I hear about NIM and it sounds like a fantastic game that gives your brain a good workout. Thank you for sharing it.
What an interesting game. It is nice to have some strategy based games.
this is such a cool game; love math based games always
Never heard of this game before but it is one to keep in mind as my son gets older to encourage fun and maths at the same time
I am loving all these games and activities that you post. They are so easy to do with regular, everyday items!
I’m glad you find these activities interesting.