← All games

Play Nim Duel Online 1v1 With Real Players

Nim is a classic mathematical strategy game that has fascinated players for over a century. Take the last stone to win. Every move is a decision — no dice, no cards, no luck.

₹15Entry
₹25Win Reward
~90sAvg Match
Play Nim Duel Now →

How to Play Nim

  1. The game starts with three piles of stones — typically 3, 5, and 7.
  2. Players take turns. On your turn, remove 1 or 2 stones from any single pile.
  3. The player who takes the last stone wins the match.
  4. There are no draws in Nim — every game has a winner.

The Winning Strategy

Nim has a perfect mathematical solution. If you know it, you can win against any opponent who doesn't — guaranteed. Here's the core idea:

The XOR trick

Write each pile size as a binary number. Compute the XOR of all three pile sizes:

nimSum = pile1 XOR pile2 XOR pile3

If the result is zero, you're in a "losing" position — you'll lose against perfect play. If it's not zero, you're in a "winning" position — you can force a win.

How to exploit a winning position

When nimSum ≠ 0, find a pile where pile XOR nimSum < pile. Reduce that pile to that new value. This leaves your opponent with nimSum = 0 — a losing position.

Opening moves

With piles of 3, 5, 7: 3 XOR 5 XOR 7 = 1. So it's a winning position for the first player. The winning move is to reduce pile 1 from 3 → 2, because 3 XOR 1 = 2.

Why Nim is a pure skill game

Nim has zero randomness. Every outcome is determined by the players' decisions. A player who knows the XOR strategy will defeat any opponent who doesn't — 100% of the time. That's why Nim is one of the purest skill-based games in existence.

Why Play Nim Duel on SkillClash

Start a Nim Duel →

Try Other Skill Games

SkillClash has 21+ skill-based games. Here are a few more you can play right now: