Play Hearts Online vs the Computer
Play Hearts — the classic four-player trick-taking card game — directly against three computer opponents, free, in your browser, with no download and no sign-up. You sit South and play the face-up hand; the AI plays West, North and East. Each deal you first pass three cards, then the holder of the two of clubs leads. Follow suit when you can, avoid winning tricks that hold hearts (one point each) or the Queen of Spades (thirteen), and try to finish with the fewest points. Beginner plays loose, punishable cards, Medium plays a solid heuristic game, and Hard runs a determinized Monte-Carlo engine. Legal cards are highlighted, and your wins are tracked per difficulty.
How the AI thinks
Hearts is not a perfect-information game like chess or Othello — you can see only your own thirteen cards — so the opponent here cannot use plain minimax. Instead the Hard level uses determinized Monte-Carlo: it repeatedly deals the cards it cannot see into the other three hands in plausible ways, respecting who has already shown void in a suit and remembering the cards it passed and to whom. Each imagined deal is a complete, perfect-information game, so the engine can simply play it out to the last trick with a fast heuristic and count the penalty points. Averaging over many such deals gives each candidate card an expected cost, and it plays the card with the lowest one. Crucially, every playout is scored after the shoot-the-moon adjustment, so the same simple objective makes the AI duck the Queen, dump points on the leader, defend against an opponent who is collecting hearts, and — when its own hand is strong enough — go for the moon itself. The whole engine runs locally in your browser, in a background worker thread so the page stays responsive, and nothing is sent to a server. It is a strong, honest opponent, though we do not claim it plays perfectly.
Curious how game-tree search works? Watch minimax and alpha-beta run, step by step →
How to play Hearts — the rules
- The deal and the pass. Four players each get thirteen cards. Before every hand you pass three cards — left, then right, then across, then a hold with no pass — and the rotation repeats.
- The lead. Whoever holds the two of clubs must lead it to the first trick. You must follow the led suit if you hold it; if you are void you may play anything, except that no hearts or the Queen of Spades may be discarded on the first trick.
- Breaking hearts. You cannot lead a heart until hearts have been "broken" — that is, until a heart has been discarded on some earlier trick.
- Scoring. Each heart is one penalty point and the Queen of Spades is thirteen, so a hand holds twenty-six points. Whoever takes a trick keeps its points. The game ends when a player reaches 100; the lowest score wins.
- Shoot the moon. Take all twenty-six points in one hand and you score zero while each opponent takes 26 instead — a huge swing, but risky.
- Hint. Stuck on a lead or a discard? Hint asks the engine for a strong card on your turn.
Tips to beat the AI
- Respect the Queen. The Queen of Spades is thirteen points on her own. Keep a low spade or two so you can duck under her, and flush her out by leading spades when you are safe.
- Get short in a suit. Passing away or playing off a whole suit lets you dump the Queen or a fistful of hearts on someone else later.
- Duck, don't win. When a trick holds points, play the highest card that still loses the trick — take the lead only when you want it.
- Watch for the moon. If one player is scooping every trick, take a point on purpose to break their run before it costs everyone 26.
FAQ
Can I play Hearts online against the computer?
Yes — that is exactly what this page is. Pick a difficulty, pass three cards, then click a highlighted card to play. Works on desktop and mobile, free, with no account.
How does the AI decide its moves?
At Hard it uses determinized Monte-Carlo — it deals the unseen cards many ways, plays each imagined game to the end, and picks the card with the lowest expected points. Playouts are scored after the moon adjustment, so it defends the moon and can shoot it too.
What does shooting the moon mean?
Taking all 26 points in a single hand. Instead of 26 you score 0, and all three opponents take 26 each — a big swing if you can pull it off without dropping a single point.
Why is the Queen of Spades so important?
She is worth thirteen points — half the hand — so avoiding the trick she lands in is central to the game. Keep low spades to duck, and pass her away when the pass allows.
Is it free? Does it work offline?
Completely free, no download, no sign-up. The engine runs client-side, so once loaded the game keeps working without a connection. More AI games: AI Chess, AI Checkers, AI Othello or AI Backgammon.