Skip to content
Random game

Gin Rummy Strategy: When to Knock and How to Win

On this page
  1. When to knock
  2. What to discard
  3. Taking from the discard pile
  4. Oklahoma Gin
  5. How to beat Foony’s Gin Rummy bots
  6. Questions players ask

Gin Rummy is a game of small choices: which card to take, which to throw, and when to end the hand. The biggest one is when to knock. Knock too early and you get undercut. Wait too long and your opponent knocks first. This guide shows how to make each choice, with numbers from games played in Foony’s own Gin Rummy code, and how Foony’s bots play.

If you need the basics, read how to play Gin Rummy first. A quick reminder of three words used here:

  • Melds are sets (3 or 4 cards of one rank) and runs (3 or more cards in a row, of one suit).
  • Deadwood is every card in your hand that isn’t in a meld. Face cards count 10, aces 1, other cards their number.
  • Knocking ends the hand. On Foony, in the standard game, you can knock when your deadwood is 10 or less.

When to knock

When you knock, your opponent lays out their melds and can add their loose cards to your melds. Then you compare deadwood.

  • If your deadwood is lower, you score the difference.
  • If theirs is the same or lower, that’s an undercut. They score the difference plus 25.
  • If you knock with 0 deadwood, that’s gin. You score their deadwood plus 25, and they can’t add cards to your melds.

A worked undercut

We scored this hand with Foony’s own scoring code. Your opponent knocks with the 7, 8, and 9 of hearts, three 4s, and the jack, queen, and king of clubs. Their one loose card is the 8 of diamonds, so their deadwood is 8.

You hold three 5s, the 10, jack, and queen of spades, and four low cards: the ace of diamonds, the ace of clubs, the 2 of diamonds, and the 2 of spades. None of those fits on their melds. Your deadwood is 1 + 1 + 2 + 2 = 6.

6 is lower than 8, so it’s an undercut. You score 25 + (8 - 6) = 27 points.

An undercut: 6 against a knock of 8Two gin rummy hands face up after a knock. Knocker: 7, 8, 9 of hearts as a run, 4 of spades, diamonds and clubs as a set, jack, queen, king of clubs as a run, and the 8 of diamonds as deadwood (8). Defender: 5 of clubs, spades and hearts as a set, 10, jack, queen of spades as a run, and the ace of diamonds, ace of clubs, 2 of diamonds, and 2 of spades as deadwood (6). A banner: 'Undercut: 25 + 2 = 27 to the defender'.

If your four loose cards had been the ace and king of diamonds, the 2 of diamonds, and the 9 of spades, the 9 would join your 10-J-Q of spades. Your deadwood would be 1 + 10 + 2 = 13, and they’d score 13 - 8 = 5.

Against people: knock early

Against a player who keeps a low hand, knocking early is usually right. Each turn you wait, they may get closer to gin or to a count that undercuts you.

Against Foony’s Expert bot: wait

Foony’s Expert bot knocks the moment it can. In games between two Expert bots, the knocker’s deadwood was 7.0 on average. That’s a high count to knock with, and a player with a low hand undercuts it.

We played 40,000 hands for each of these rules against the Expert bot, twice. In each test, one seat played exactly like the Expert bot, except for when it knocked:

Your rule Points per hand against the bot
Knock at 10 or less (same as the bot) about 0
Knock at 7 or less about 0
Knock at 5 or less +0.7 to +0.8
Knock at 3 or less +1.5 to +2.0
Gin only +3.6 to +3.9
Points per hand against the Expert bot, by when you knockA bar chart titled 'Points per hand against the Expert bot, by when you knock': knock at 10 or less about 0, at 7 or less about 0, at 5 or less +0.7 to +0.8, at 3 or less +1.5 to +2.0, gin only +3.6 to +3.9. Caption: two runs of 40,000 hands for each rule.

The table shows the range of the two runs. The first two rows are a tie with the bot. With the “gin only” rule, the bot knocked first in most hands, and in 31% of all hands its knock was undercut. That’s where most of the extra points came from.

So against the Expert bot, keep building melds and keep your loose cards low. Knock when your deadwood is 3 or less, or go for gin.

What to discard

Throw high loose cards first. A king you can’t use costs 10 if the other player knocks. A 2 costs 2. Early in the hand, a lone face card is usually the right discard.

Keep cards that are one away from a meld. Two 9s need one more 9. A 5 and 6 of hearts need a 4 or 7 of hearts. These pairs are how you get to gin.

When you’re stuck between two discards, throw the higher one. Foony’s bots break ties the same way. The deadwood you hold next turn is the same, and you risk less if the other player knocks now.

Which card to discard firstA 10-card hand: 4, 5, 6 of hearts, three 9s (clubs, diamonds, spades), 2 of clubs, 3 of diamonds, jack of spades, king of diamonds. The king of diamonds is lifted with a label 'Discard first: 10 points, no partner card'. The 2 and 3 are marked 'Cheap to keep'.

Watch what your opponent takes. A player who takes a discard is collecting that rank or that run. If they take the 7 of clubs, don’t throw them another 7, or the 6 or 8 of clubs.

Watch what they throw. A player who throws the jack of spades probably isn’t collecting jacks. Other jacks are safer to throw them.

Taking from the discard pile

Take the top discard only when it goes into a meld. If you take it for any other reason, your opponent sees what you want and you gain nothing. Foony’s Expert bot follows this rule exactly. So when an Expert bot takes a discard, you know it just made a meld with it.

Oklahoma Gin

In Oklahoma Gin, the first face-up card sets the knock limit for the hand. A 7 means you can knock at 7 or less. A face card means 10, and an ace means you need gin. Look at that first card before you plan. With a low limit, aim for gin from the start.

How to beat Foony’s Gin Rummy bots

The host picks one level for every bot:

Level How often a choice is random
Easy Every draw and discard
Casual About 60%
Skilled (default) About 30%
Expert Never

Every level knocks when its discard leaves 10 or less, so even Easy ends hands. What the bots do, from the bot code:

  • They knock as soon as they can. That’s the biggest thing to use. Keep a low hand and you’ll undercut them often.
  • They take a discard only to make a meld. If a bot takes a card, don’t throw it cards that fit with it.
  • They discard the card that leaves the least deadwood. They don’t think about what you’re collecting, so they’ll throw you the card you need.
  • They don’t remember which cards you’ve taken or passed. They won’t hold a card back to block you.

Ready to try? Play Gin Rummy against an Expert bot and see how often you can undercut it.

The test hands were played on 2026-11-20 with Foony’s own Gin Rummy code and its Expert bot, standard rules, knock at 10.

Questions players ask

When should you knock in Gin Rummy?

Against a player who keeps a low hand, knock early, since if you wait, they have time to catch up. Against a player who knocks the moment they can, like Foony's Expert bot, keep building and wait for a much lower count or gin, because their early knocks are easy to undercut.

What is an undercut in Gin Rummy?

When a player knocks and the other player's deadwood (the cards not in a set or run) is the same or lower after laying cards off. The other player scores the difference plus a 25-point bonus.

Is it better to go for gin or knock?

It depends on your opponent. In our test against Foony's Expert bot, a player who waited for gin scored about 3.6 to 3.9 points more per hand than one who knocked as soon as it could.

What cards should you discard first in Gin Rummy?

High cards that aren't in a set or run, like a lone king or queen. They cost 10 points each if your opponent knocks. Keep low cards and cards that are one away from a set or run.

Should you pick up from the discard pile?

Only when the card finishes or builds a set or run. Taking a card shows your opponent what you're collecting.

How good are the Gin Rummy bots on Foony?

There are 4 levels: Easy, Casual, Skilled, and Expert. Expert never makes a random choice, but it knocks as soon as it can, at about 7 points of deadwood on average, and it doesn't track the cards you pick up.