Skip to content
NexoraPlay
Nim

Nim

Take fireflies from the jars — and make the last move count.

Embed

Paste this code into your page or blog. The game plays right there, free, with no sign-up — and your visitors can find more games at Nexora Play.

Embedded games keep best scores on the player's device. Saved progress, accounts and leaderboards need the full page on Nexora Play.

Report

What kind of report?

Don't include your name, email, phone number or other personal details. We remove emails and phone numbers automatically. Privacy policy

Play more

Picked for you: switch lists to find your next game

About Nim

Also called nim game online, nim strategy, nim against the computer, misere nim.

Nim is the classic take-away game of pure strategy, set in a twilight garden where every heap is a glass jar of glowing fireflies and every firefly you take drifts up into the night, to a slow lo-fi groove. On your turn take any number from one jar; normally the last firefly wins, but on last-one-loses rounds it loses. This nim game online has 30 rivals: one-jar take-away games, then classic Nim with up to five jars, then misère rounds and big jars. You always start from a winning position and the later rivals never slip, so learn the nim strategy and keep the win. Undo, hints, stars and saved progress.

How to play

Tap a firefly to select it and every firefly above it, then tap TAKE to remove them from that jar. Alternatively, tap the same firefly again to confirm. Use left and right arrows to choose a jar, up and down arrows to change how many fireflies you take, and Enter to take them. Press U or Z to undo, H for a hint, R to restart, and P or Esc to pause. Take turns with the computer until all fireflies are gone. In normal rounds, take the last firefly to win; in misere rounds, avoid taking the last firefly.

Controls
ActionKeyboardTouch
Select jar←→Tap a jar
Change count↑↓Tap fireflies to select
Take firefliesEnterTap TAKE
UndoUZ—
HintHHINT button
RestartR—
PausePEsc—

Tips for Nim

  • In one-jar take-away games, leave a multiple of the limit plus one firefly to force your rival into a losing position.
  • For multi-jar Nim, write jar sizes in binary and make every column even by zeroing the nim-sum.
  • If you have two equal jars, mirror your rival's move in the other jar to maintain control.
  • In last-one-loses misere Nim, play normal Nim until only jars of one firefly are left, then leave an odd number of jars.
  • Use the HINT button to reveal the winning move and learn the pattern for future levels.
  • Count the fireflies carefully before you take; a small mistake can turn a winning position into a loss.

Questions about Nim

How do you play Nim?

On your turn, take any number of fireflies from one jar. In normal rounds, the player who takes the last firefly wins. In misere rounds, the player who takes the last firefly loses. You always move first from a winning position, so your goal is to find the move that keeps your win.

Is there a trick to always win at Nim?

Yes. The key is the nim-sum. Write each jar size in binary and XOR them together. If the nim-sum is zero, the position is losing for the player to move. To win, make a move that leaves a nim-sum of zero for your rival. In one-jar games, this means leaving a multiple of the limit plus one.

What is last-one-loses Nim?

Last-one-loses, or misere Nim, is a variant where taking the last firefly loses the game. The strategy is similar to normal Nim until only jars of one firefly remain. Then, leave an odd number of jars with one firefly each to force your rival to take the last one.

How are the levels structured?

There are 30 rivals. Early levels use one jar with take limits of 1 to 3, 4, or 5. Middle levels feature classic Nim with 2 to 5 jars. Later levels include misere rounds and big jars. From rival 4 on, the computer plays perfectly, so every level is a puzzle.

Is Nim free?

Yes. Nim is free to play on Nexora Play, with no download and no sign-up needed.

Can I play Nim on my phone?

Yes. It runs in the browser on computers, tablets and phones, with touch controls on phones and tablets. You can also add Nexora Play to your home screen like an app.

Do I need an account?

No. You can play as a guest and your best scores are kept in this browser. A free account (13+) keeps your progress across devices.

More puzzle games