

import {useState} from 'react'; export function MiniCard({r, s, dim, tag}) { const red = s === '♥' || s === '♦'; return ( <span className={ 'flex h-11 w-8 flex-col items-center justify-center rounded-md bg-[#fdfcf5] font-black leading-none shadow-[0_2px_5px_rgba(0,0,0,.45)] ' + (red ? 'text-[#e8334f] ' : 'text-[#241b35] ') + (dim ? 'opacity-35 ' : '') } > {r} {s} {tag != null && ( {tag} )} ); }
export function HandRow({name, groups, loose, extra}) { return (
export function HandPaysExplorer() { const YOUR_KNOCK_GROUPS = [ [{r: '2', s: '♣'}, {r: '3', s: '♣'}, {r: '4', s: '♣'}], [{r: '9', s: '♥'}, {r: '9', s: '♦'}, {r: '9', s: '♠'}], ]; const THEIR_GROUPS = [ [{r: '5', s: '♥'}, {r: '6', s: '♥'}, {r: '7', s: '♥'}], [{r: 'K', s: '♣'}, {r: 'K', s: '♦'}, {r: 'K', s: '♠'}], ]; const THEIR_LOOSE = [{r: '8', s: '♦', tag: '8'}, {r: '6', s: '♣', tag: '6'}]; const SCENARIOS = [ { id: 'knock', label: 'Knock', pill: 'bg-blue-400 shadow-[0_2px_0_#1d4ed8]', caption: 'Green cards are in groups and safe. Pink cards are not, and their points count. You hold 6, they hold 14, and you score the gap.', you: {groups: YOUR_KNOCK_GROUPS, loose: [{r: '4', s: '♦', tag: '4'}, {r: '2', s: '♥', tag: '2'}]}, them: {groups: THEIR_GROUPS, loose: THEIR_LOOSE}, math: '14 − 6', result: '+8 for you', resultClass: 'text-emerald-300', }, { id: 'gin', label: 'Gin', pill: 'bg-amber-400 shadow-[0_2px_0_#b45309]', caption: 'All ten of your cards sit in groups, so you hold 0 and they cannot slot anything onto you. You score all 14 of their points, plus a 25-point bonus.', you: { groups: [ [{r: '2', s: '♣'}, {r: '3', s: '♣'}, {r: '4', s: '♣'}, {r: '5', s: '♣'}], [{r: '9', s: '♥'}, {r: '9', s: '♦'}, {r: '9', s: '♠'}], [{r: 'A', s: '♦'}, {r: '2', s: '♦'}, {r: '3', s: '♦'}], ], loose: [], }, them: {groups: THEIR_GROUPS, loose: THEIR_LOOSE}, math: '14 + 25', result: '+39 for you', resultClass: 'text-amber-300', }, { id: 'biggin', label: 'Big Gin', pill: 'bg-amber-400 shadow-[0_2px_0_#b45309]', caption: 'All eleven cards form groups the moment you draw, before you even discard. Same as gin, but the bonus grows to 31.', you: { groups: [ [{r: '2', s: '♣'}, {r: '3', s: '♣'}, {r: '4', s: '♣'}, {r: '5', s: '♣'}], [{r: '9', s: '♥'}, {r: '9', s: '♦'}, {r: '9', s: '♠'}], [{r: 'A', s: '♦'}, {r: '2', s: '♦'}, {r: '3', s: '♦'}, {r: '4', s: '♦'}], ], loose: [], }, them: {groups: THEIR_GROUPS, loose: THEIR_LOOSE}, math: '14 + 31', result: '+45 for you', resultClass: 'text-amber-300', }, { id: 'undercut', label: 'Undercut', pill: 'bg-rose-400 shadow-[0_2px_0_#be185d]', caption: 'You end the hand holding 6, but their spare 5 of clubs slots onto your 2-3-4 run and stops counting. That drops them to 5, under your 6, so the hand flips: they score the gap, plus a 25-point bonus.', you: { groups: [ [{r: '2', s: '♣'}, {r: '3', s: '♣'}, {r: '4', s: '♣'}, {r: '5', s: '♣', tag: 'theirs'}], [{r: '9', s: '♥'}, {r: '9', s: '♦'}, {r: '9', s: '♠'}], ], loose: [{r: '4', s: '♦', tag: '4'}, {r: '2', s: '♥', tag: '2'}], }, them: {groups: THEIR_GROUPS, loose: [{r: '5', s: '♦', tag: '5'}, {r: '5', s: '♣', dim: true, tag: 'moved'}]}, math: '6 − 5 + 25', result: '+26 for them', resultClass: 'text-rose-300', }, ]; const [tabId, setTabId] = useState('knock'); const tab = SCENARIOS.find(scenario => scenario.id === tabId) ?? SCENARIOS[0]; return (
How a Hand Pays
{tab.caption}
export function KnockExplorer() { const C = (r, s, tag) => ({r, s, tag}); const CLUBS_RUN = [C('2', '♣'), C('3', '♣'), C('4', '♣'), C('5', '♣')]; const NINES = [C('9', '♥'), C('9', '♦'), C('9', '♠')]; const DIAMONDS_RUN = [C('6', '♦'), C('7', '♦'), C('8', '♦')]; const HAND = [ {id: '2c', rank: '2', suit: '♣', red: false, deadwood: 10, verdict: 'knock', note: 'The 3-4-5 of clubs stay a group and 6-7-8 of diamonds forms one. Only the queen is left over: 10 points, just low enough to knock.', groups: [[C('3', '♣'), C('4', '♣'), C('5', '♣')], NINES, DIAMONDS_RUN], loose: [C('Q', '♠', '10')]}, {id: '3c', rank: '3', suit: '♣', red: false, deadwood: 21, verdict: 'none', note: 'Without the 3, the 2, 4, and 5 of clubs stop being a group. With the queen, 21 points are left over.', groups: [NINES, DIAMONDS_RUN], loose: [C('2', '♣', '2'), C('4', '♣', '4'), C('5', '♣', '5'), C('Q', '♠', '10')]}, {id: '4c', rank: '4', suit: '♣', red: false, deadwood: 20, verdict: 'none', note: 'Without the 4, the 2, 3, and 5 of clubs stop being a group. With the queen, 20 points are left over.', groups: [NINES, DIAMONDS_RUN], loose: [C('2', '♣', '2'), C('3', '♣', '3'), C('5', '♣', '5'), C('Q', '♠', '10')]}, {id: '5c', rank: '5', suit: '♣', red: false, deadwood: 10, verdict: 'knock', note: '2-3-4 of clubs is still a group and 6-7-8 of diamonds forms one. Only the queen is left over: exactly 10, a legal knock.', groups: [[C('2', '♣'), C('3', '♣'), C('4', '♣')], NINES, DIAMONDS_RUN], loose: [C('Q', '♠', '10')]}, {id: '9h', rank: '9', suit: '♥', red: true, deadwood: 19, verdict: 'none', note: 'A surprise: the three 9s split up, but the 9 of diamonds just joins 6-7-8 of diamonds instead. The other 9 and the queen are left over: 19 points.', groups: [CLUBS_RUN, [...DIAMONDS_RUN, C('9', '♦')]], loose: [C('9', '♠', '9'), C('Q', '♠', '10')]}, {id: '9d', rank: '9', suit: '♦', red: true, deadwood: 28, verdict: 'none', note: 'The worst pick. The 9s of hearts and spades have nowhere to go, so both count against you with the queen: 28 points.', groups: [CLUBS_RUN, DIAMONDS_RUN], loose: [C('9', '♥', '9'), C('9', '♠', '9'), C('Q', '♠', '10')]}, {id: '9s', rank: '9', suit: '♠', red: false, deadwood: 19, verdict: 'none', note: 'A surprise: the three 9s split up, but the 9 of diamonds just joins 6-7-8 of diamonds instead. The other 9 and the queen are left over: 19 points.', groups: [CLUBS_RUN, [...DIAMONDS_RUN, C('9', '♦')]], loose: [C('9', '♥', '9'), C('Q', '♠', '10')]}, {id: '6d', rank: '6', suit: '♦', red: true, deadwood: 25, verdict: 'none', note: 'You just drew this card, and it completes 6-7-8 of diamonds. Throw it back and the 7, 8, and queen are left over: 25 points.', groups: [CLUBS_RUN, NINES], loose: [C('7', '♦', '7'), C('8', '♦', '8'), C('Q', '♠', '10')]}, {id: '7d', rank: '7', suit: '♦', red: true, deadwood: 24, verdict: 'none', note: 'Without the 7, the 6 and 8 of diamonds no longer connect. They are left over with the queen: 24 points.', groups: [CLUBS_RUN, NINES], loose: [C('6', '♦', '6'), C('8', '♦', '8'), C('Q', '♠', '10')]}, {id: '8d', rank: '8', suit: '♦', red: true, deadwood: 23, verdict: 'none', note: 'Without the 8, the 6 and 7 of diamonds are one card short of a group. With the queen, 23 points are left over.', groups: [CLUBS_RUN, NINES], loose: [C('6', '♦', '6'), C('7', '♦', '7'), C('Q', '♠', '10')]}, {id: 'qs', rank: 'Q', suit: '♠', red: false, deadwood: 0, verdict: 'gin', note: 'The queen was the only card without a group. Everything else fits perfectly: that is gin, worth their whole count plus a 25-point bonus.', groups: [CLUBS_RUN, NINES, DIAMONDS_RUN], loose: []}, ]; const [pickedId, setPickedId] = useState(null); const picked = HAND.find(card => card.id === pickedId) ?? null; return (
Try It: Pick Your Discard
You just drew the 6 of diamonds and hold these 11 cards. The 2-3-4-5 of clubs and the three 9s already form groups. Click the card you would throw away:
The verdict appears here. Hint: one discard is a knock, one is even better.
) : ({picked.note}
<p className={'shrink-0 text-lg font-black tabular-nums ' + (picked.deadwood <= 10 ? 'text-emerald-300' : 'text-rose-300')}> {picked.deadwood}Gin Rummy Online
Foony Gin Rummy is a free online gin rummy game for two players, with invite-link rooms, four bot difficulty levels, and a table that does the counting for you, so you always know exactly when you can end the hand. It features the full classic rule set: knocking, gin, big gin, layoffs, and the undercut, and every one of those words is explained on this page. Matches run to 50, 100, or 150 points, and only one player can score in any hand, so there is never a tie.
The gin card game is barely a century old and it has star power in its blood. Whist tutor Elwood T. Baker devised it in New York around 1909, and by the 1930s and 40s it was the card game of Hollywood sets and Broadway dressing rooms, famously beloved by stars and screenwriters who needed a game they could pause for a take and pick back up on cue, a history documented on Wikipedia's gin rummy page. That history is why it is still the classic head-to-head card game: hands are quick, you never see your opponent's cards, and every turn ends on the same big decision: knock now, or push for more.
Play Gin Rummy Online with Friends or Against Bots
Make a room, send the link to a friend, and they can join in seconds from any browser (mobile and desktop both work). The host sets the match in the lobby: play to 50 for a quick break, the traditional 100, or 150 for a long duel, with a turn timer from 10 to 60 seconds or none at all. The table itself does the bookkeeping. Your hand sorts itself into melds, a chip above your cards shows your exact deadwood count at every moment, and the Knock button simply appears whenever knocking is legal.
You can play solo against Easy, Casual, Skilled, or Expert bots. Expert plays the textbook game: it takes from the discard pile only when the card completes a group, and it knocks the moment it can. Beating it means playing the odds better, not waiting for a blunder. Solo games earn less XP than games against players, scaled to the bot difficulty.
A gin rummy table seats exactly two, but a Foony room holds up to 100 people. Extra players are sorted into the two sides and take their turns round-robin style, so everyone gets to play.
How to Play Gin Rummy
Each player gets 10 cards, one card is turned face up to start the discard pile, and the rest sit face down as the stock. On your turn you draw one card, either the mystery card from the stock or the visible top of the discard pile, and then discard one. Your goal is to sort your hand into melds: groups of cards that score nothing against you. A meld takes one of two shapes, and every card that fits neither is deadwood:
Meld · Run
Three or more cards of one suit in sequence, like 6-7-8 of hearts. Aces are low: A-2-3 works, Q-K-A does not.
Meld · Set
Three or four cards of the same rank, like three queens. A card can serve a run or a set, never both at once.
Not a Meld · Deadwood
Every card that fits in no meld. Aces count 1, number cards their face value, and jacks, queens, and kings count 10 each.
When your deadwood totals ten points or less, you may knock: discard, reveal both hands, and end the hand right there. Your opponent then gets one consolation, called laying off: any of their loose cards that fit your melds move onto them and stop counting. Whatever deadwood remains on each side is compared, and the scoring follows the standard rules kept at Pagat's gin rummy page. Here is one hand ending four different ways; click through them:
Two more rules and you know the whole game. You cannot throw back the card you just took from the discard pile on the same turn. And if the stock runs down to its last two cards before anyone knocks, the hand ends with no score and a fresh deal. The first turn of each hand also has one extra choice, the upcard option: the non-dealer, then the dealer, may claim the opening face-up card before normal drawing starts.
That is the whole rulebook, so put it to work. This is a real decision from a real deal, the same arithmetic the game runs for you on every turn:
Oklahoma Gin
In Oklahoma Gin, each hand's opening upcard sets that hand's knock limit: flip a 7 and knocking needs seven or fewer deadwood, flip a face card and the usual ten applies, and flip an ace and only gin ends the hand. The table shows the live limit beside your deadwood chip, so the rule never has to be remembered, only played. Oklahoma hands run longer and reward patient hand-building.
Gin Rummy Strategy
The winning habit in gin rummy is simple: knock as soon as the button lights up. Holding out for gin is tempting, but every extra turn is another chance for your opponent to knock first, or to drop below your count and undercut you. Save the gin chase for hands where your deadwood is already tiny and the match score demands a bonus.
Draw from the stock unless the discard genuinely completes a meld. Taking a card your opponent can see tells them what you are collecting. It works in reverse too: every card they take from the pile narrows down what they hold, and every card they discard tells you what they are not building. Avoid discarding cards close to the ones they have picked up.
Get rid of your expensive loose cards first. An unpaired king costs 10 points while it waits for a miracle. A lone 3 does the same waiting and costs only 3. Middle cards like 5s through 8s connect into runs from both directions, so when two discards look equally useless, keep the middle card and dump the edge. And watch the stock counter: as it shrinks toward the two-card cutoff, a modest knock beats a dead hand where your built-up position pays nothing.
Leaderboards and Achievements
Every match is tracked in the daily, weekly, monthly, yearly, and all-time Gin Rummy leaderboards. The six Gin Rummy achievements cover the game's best moments: Off and Running for your first finished match, Going Gin for a zero-deadwood knock, Undercut for turning a knocker's own hand against them, Big Gin for melding all eleven straight off the draw, Comeback Kid for winning after trailing by 50, and Shutout for a match where your opponent never scores at all (bots only count from Skilled difficulty up).
Knockers and defenders alike collect Foony coins and account XP from every hand, and that progress follows you across every game on Foony. Winning just pays a richer rate.
Gin Rummy vs Rummy
Straight rummy and gin rummy are built from the same runs and sets, but they play very differently. In straight rummy, melds go down on the table as they form, everyone watches everyone's progress, and hands end only when someone goes out completely. Gin keeps every meld hidden until the moment of the knock, scores the leftover cards, and lets a hand end early on a ten-point judgment call, which turns each deal into a bluffing race rather than a slow reveal. That combination of secrecy and timing is why gin took over the two-player table. If you would rather bid on tricks than hide melds, Foony Spades has the same instant invite-link rooms.
Oklahoma Gin