gekro
GitHub LinkedIn

Solitaire

Play free Klondike Solitaire with Draw 1 or Draw 3, drag and drop or keyboard play, unlimited undo, auto-complete and deal numbers you can share.

Deal #-

Moves 0

Time 0:00

Home 0 / 52

Best -

Wins 0

Drag a card or a run to a column or foundation, or click a card and then where it should go. Selecting the same card again sends it to its foundation if it fits, or deselects it. Keyboard: arrow keys move between piles, and Up and Down step through the face-up cards of a column. Enter picks up the card or run under the cursor, then drops it on the pile you move to. F sends the top card to its foundation, U undoes, Escape cancels. Enter on the stock turns cards over. Random deals are shuffled, not checked, so some of them cannot be won. Hearts and diamonds are the red suits (warm rose and amber); spades and clubs are the black suits (cool violet and teal). Each card also shows its suit symbol.

How the deals work

A deal number is the seed of a shuffle, so the same number always gives the same layout. That is why the address of this page carries the number: send it to someone and they get your exact deal. Seven columns are dealt with one to seven cards, only the last of each face up, and the other 24 cards form the stock. Draw 1 turns one card at a time, Draw 3 turns three, and when the stock runs out the waste is turned back over with no limit on passes. Deals are not filtered for winnability, so a small share of them have no winning line. Auto-complete is offered only when every card on the table is face up and the stock is empty, because from there the game can always be finished.

As-is, no warranty. These apps are free under their listed license and run entirely in your browser. Use at your own risk — don't blame me if your PC catches fire, your dog runs away, or the math turns out wrong. Verify anything that actually matters. None of this is professional financial, medical, legal, or engineering advice.

© 2026 Rohit Burani · MIT · Built at gekro.com · View source ↗

Guide

How to play

Move every card onto the four foundations at the top right, one per suit, from Ace up to King. The seven columns start with one to seven cards, and only the last card of each column is face up. The other 24 cards are the stock.

  • Columns: build downwards, alternating between red suits and black suits, so a red 6 goes on a black 7. Hearts and diamonds are the red suits and are drawn in warm hues (rose and amber); spades and clubs are the black suits and are drawn in cool hues (violet and teal). Every card also carries its suit symbol, so you never have to rely on the hue. A run of face-up cards moves as one unit. Only a King, or a run that starts with a King, can go into an empty column.
  • Foundations: each one belongs to a suit and takes that suit in order, starting with the Ace. A single card goes to a foundation; a run cannot.
  • Face-down cards: when you move the last face-up card away from a column, the card beneath it turns over by itself.
  • Stock and waste: click the stock to turn cards onto the waste, where only the top card can be played. Draw 1 turns one card, Draw 3 turns three (fewer at the end of the stock). When the stock is empty, clicking it turns the waste back over to make a new stock, with no limit on passes.

The cards are drawn with CSS: a tinted face, a coloured band behind the rank and suit in the corner, and a soft disc behind the large suit symbol. Face-down cards have diagonal bands of sky, violet and rose with an amber centre dot. The table is a deep violet-blue. When you win, the table glows twice and a message appears with your time and a Copy button; no cards fly around, and the glow is off if your system asks for reduced motion.

There are three ways to move, and you can mix them:

  1. Drag and drop a card or a run onto a column or a foundation. Piles where the move is legal are outlined while you drag. Letting go on the pile the cards came from, or anywhere that is not a legal pile, puts them back; if the table changed while you were dragging (for example you pressed U), the drop is cancelled.
  2. Click, then click. Click a card (the selected card or run gets an outline), then click where it should go. Selecting the same card again sends it to its foundation if it fits, otherwise it deselects.
  3. Keyboard. Arrow keys move a cursor between piles; Up and Down also step through the face-up cards of a column to choose how long a run to pick up. Enter picks up the card or run under the cursor, and on the next pile you move to, Enter drops it. F sends the top card to its foundation, U undoes, Escape cancels. Enter on the stock turns cards over.

Undo has no limit. Restart this deal replays the same cards from the beginning. Auto-complete switches on when every card on the table is face up and the stock is empty, and then plays the rest to the foundations one step at a time (all at once if your system asks for reduced motion). The timer starts on your first move and pauses while the tab is hidden.

Each deal has a number. The page address carries it as ?deal= along with the draw setting, so copying the address, or using Copy result, gives someone the same deal.

How it works

A card is a number from 0 to 51: the suit is the number divided by 13 (rounded down) and the rank comes from the remainder. A deal is a Fisher-Yates shuffle driven by a small seeded generator (mulberry32), so a deal number always produces the same order of cards. Column k takes k + 1 cards from the top of the shuffled deck, and the remaining 24 become the stock. Random deals use a number from 1 to 999,999 drawn with the browser’s secure random source; an address can carry any whole number up to 4,294,967,295.

The rules live in a plain TypeScript module with no page code in it. A game state is never changed in place: playing a move returns a new state, or nothing at all if the move is illegal. That makes undo simple (keep the earlier states) and makes the rules easy to test. The foundation check, the column check and the run check are three short functions, and the interface calls the same ones to decide which piles to outline while you drag.

Auto-complete is safe to offer because of a simple argument. Once every column is face up and the stock is empty, each column runs from high rank to low, so the lowest card still in play is either the top of a column or somewhere in the waste. Its suit has already been built up to just below it, so it can go to its foundation. When the card you need is in the waste, auto-complete turns it over one card at a time, even in Draw 3, so every waste card gets its turn. The tests check this on 40 positions built by working backwards from a finished game, in both draw modes, with and without cards left in the waste.

The test suite also covers the deal layout (28 cards in the columns, 24 in the stock, one face-up card per column), each legality rule including King-to-empty and wrong-colour and wrong-rank rejections, runs moving as units, automatic flipping, stock and waste cycling in both draw modes including the short turn at the end of the stock, and determinism for a deal number. A random-play fuzz then plays more than 5,000 random legal moves across 60 deals and, after every single move, checks that exactly 52 distinct cards exist, that face-down cards only sit under face-up ones, that every column run is valid and that every foundation is in order.

Privacy and storage

Nothing is uploaded and there is no account. Your best winning time and your win count, for each draw mode, are saved in your browser’s local storage as small numbers inside a small JSON object, under one key. Only wins are counted. Stored values that are not whole numbers (times up to 99 hours 59 minutes 59 seconds, win counts up to one million) are ignored when read. Clearing site data removes them. The only other state is the page address.

Limits

  • Random deals are shuffled, not filtered, so some of them cannot be won. The tool does not check, and it does not tell you when you have run out of useful moves.
  • There is no hint button and no scoring mode; the measures are moves, time and best time.
  • Passes through the stock are unlimited in both draw modes.
  • Each foundation is fixed to one suit rather than taking whichever Ace arrives first.
  • In Draw 3 the waste shows its top three cards, and only the top one can be played.
  • On a touch screen, dragging stops the page from scrolling when you start on a face-up card. Tapping a card and then its destination works everywhere.
  • It does not save a game in progress. Reloading the page with the same address gives you the same deal from the start.

Everything runs locally in your browser.

All Fun tools →

For informational purposes only. Not financial, medical, or legal advice. You are solely responsible for how you use these tools.