Free Printable Nim Rules

About Free Printable Nim Rules

It depends on which version you agree on before starting. In normal play taking the last object wins; in misère play, the traditional version shown in the 1961 film Last Year at Marienbad, the player forced to take the last object loses.

By the ToolFluency team · Updated October 2026

Want to play instead? Play Nim online, free in your browser. Nim is a 2-player strategy game played with a handful of identical objects such as coins, matchsticks or counters, set out in piles. Players take turns removing any number of objects from one pile, and depending on the version you agree on, taking the last object either wins (normal play) or loses (misère play). A game takes about 5 to 15 minutes, and the full printable rules sheet with pile diagrams is on this page.

How to play Nim

  1. Agree on the win rule: in normal play the player who takes the last object wins; in misère play, the traditional version, the player forced to take the last object loses.
  2. Set out the piles: use 16 objects in four rows of 1, 3, 5 and 7 (the Marienbad layout), or 12 objects in three piles of 3, 4 and 5. Keep the piles clearly apart and agree on the counts before the first move.
  3. Choose who starts: flip a coin, let the youngest go first, or alternate between games.
  4. Take a turn: pick exactly one pile and remove at least one object from it. You may take as many as you like from that pile, up to the whole pile.
  5. Know what's not allowed: you can't take from two piles in one turn, you can't pass, and you can't split a pile into two. A pile of 7 with 3 removed is simply a pile of 4.
  6. Alternate turns until every object has been removed, setting removed objects aside out of play.
  7. Declare the winner: in normal play, whoever took the last object wins; in misère, whoever took it loses. Nim has no ties.

Examples

Strategy tips
  • Write each pile size in binary and combine them with XOR (the nim-sum). If it is not zero, there is a move that makes it zero, and making it is the winning move.
  • If the nim-sum is already zero on your turn, you are losing against perfect play. Make a small move and hope your opponent slips.
  • The 1-3-5-7 layout starts at nim-sum 0, so the second player can always win. In casual games, let the younger or weaker player choose whether to go first or second.
  • The 3-4-5 layout has nim-sum 2, so the first player can win by taking 2 from the pile of 3, leaving 1-4-5.
  • In misère play, follow the same nim-sum strategy until only one pile has 2 or more objects. Then take from that pile so you leave an odd number of single-object piles (in normal play, leave an even number).
  • In normal play, two equal piles are a win for the player who just made them equal: copy whatever your opponent takes from one pile by taking the same from the other.
Example: working out the nim-sum
Start from piles of 3, 4 and 5. In binary these are 011, 100 and 101. XOR them column by column: 011 XOR 100 = 111, and 111 XOR 101 = 010, which is 2. The nim-sum is not zero, so the first player can win. Taking 2 from the pile of 3 leaves 1, 4 and 5 (001, 100, 101), whose nim-sum is 0, handing your opponent a losing position.

Frequently asked questions

Does the player who takes the last object win or lose in Nim?

It depends on which version you agree on before starting. In normal play taking the last object wins; in misère play, the traditional version shown in the 1961 film Last Year at Marienbad, the player forced to take the last object loses.

Can you take from more than one pile in a turn?

No. Every move must come from a single pile. Taking 2 from one row and 1 from another in the same turn counts as two moves and is illegal.

Can you pass or split a pile in Nim?

Neither is allowed. You must remove at least one object every turn, and removing objects never splits a pile into two. A pile of 7 with 3 taken out from the middle is still one pile of 4.

What is the winning strategy for Nim?

Compute the nim-sum, the XOR of all pile sizes in binary (Bouton's theorem, 1901). If it is not zero, the player to move can win by making a move that brings it to zero. If it is already zero, the player to move loses against perfect play.

Who wins 1-3-5-7 Nim with perfect play?

The second player. Its nim-sum is 1 XOR 3 XOR 5 XOR 7 = 0, so whoever moves first is already in a losing position if the other player never makes a mistake.

How is misère strategy different from normal play?

The two only differ near the end. Play the usual nim-sum strategy until exactly one pile has 2 or more objects left. Then, in misère, reduce that pile so your opponent faces an odd number of single-object piles; in normal play, leave an even number.

What is the 21 Game?

It is a single-pile version of Nim with 21 objects, or counting aloud from 1 to 21. Each turn you take 1, 2 or 3, and the player forced to take the 21st (last) object loses. It needs no materials at all.

Part of ToolFluency’s library of free online tools for Printables. No account needed, no data leaves your device.

Embed this tool on your site (free)
Paste this where you want the tool. Please keep the attribution link.
<iframe id="tf-nim-rules" src="https://toolfluency.com/tools-v2/printables/games/nim-rules.html?embed=1" width="100%" height="640" loading="lazy" style="border:1px solid #e2e2e2;border-radius:12px;max-width:760px" title="Free Printable Nim Rules by ToolFluency"></iframe>
<script>addEventListener("message",function(e){var f=document.getElementById("tf-nim-rules");if(f&&e.source===f.contentWindow&&e.data&&e.data.tfEmbedHeight){f.height=e.data.tfEmbedHeight}});</script>
<p>Powered by <a href="https://toolfluency.com/tools-v2/printables/games/nim-rules.html">Free Printable Nim Rules</a> — free tools by ToolFluency</p>