Matching Pairs Game

Turn over two cards – if they match, the pair is yours and you go again. If not, they are turned face down. Remember where everything is and you win.

Your inputs are saved in this browser only.

Tap a card to turn it over

    Tip: use Tab and the arrow keys to move around, Enter turns a card.

    Result

    How it is calculated

    How to play

    1. Choose the board, the number of players and the pictures. Every picture appears exactly twice.
    2. On each move, tap two cards. If they match, they stay face up, count as a pair for the current player, and that player goes again.
    3. If they differ, they are turned back after one second and it is the next player’s turn.
    4. When all pairs are found, whoever has the most wins. Solo, your moves and time count.

    On a computer everything works by keyboard too: Tab jumps into the board, the arrow keys move, Enter or Space turns a card.

    Fairly shuffled

    Before each game the cards are shuffled with the Fisher–Yates algorithm; the random numbers come from the browser’s crypto.getRandomValues() (W3C Web Cryptography API) without modulo bias. Every layout is equally likely and nobody can predict the board.

    How many moves is good?

    Even with perfect memory you cannot avoid some guessing. Velleman and Warrington showed in the American Mathematical Monthly (2013) that with n pairs an optimal player needs on average about (3 − 2 ln 2) · n + 7/8 − 2 ln 2 ≈ 1.61 · n moves. With 8 pairs (16 cards) that is about 12 moves, with 18 pairs about 29. After a solo game the tool shows this value for comparison – as a guide, not a grade.

    Notes

    Frequently asked questions

    How does the matching pairs game work?

    All cards start face down. On each move two are turned over; a matching pair is kept and the player goes again, otherwise both are turned back. Whoever has the most pairs at the end wins.

    Can two people or kids play together?

    Yes, 2 to 4 players can share one device. Scores are shown above the board and the current player is highlighted. For young children, 12 cards with animals are ideal.

    How many moves does it take on average?

    With perfect memory and the best strategy, about 1.61 moves per pair (Velleman and Warrington, 2013) – roughly 12 for 16 cards. Anything below that means lucky guesses.

    Are the cards really shuffled randomly?

    Yes. They are shuffled with the Fisher–Yates algorithm using the browser’s cryptographic random numbers, so every layout is equally likely.

    Does the game work on phones and tablets?

    Yes, in any current browser. The cards adapt to the screen width; on small phones 4 × 4 is the most comfortable size.

    Sources and legal basis

    As of:

    Related tools