Nash Equilibrium Calculator
Type in the payoffs of a two-player game with up to five strategies each, or load a classic such as the prisoner's dilemma. The calculator underlines each player's best responses, marks the pure-strategy Nash equilibria, looks for dominant strategies, and for a 2×2 game works out the mixed equilibrium with its probabilities and expected payoffs.
Players
Payoff matrix
Each cell holds two payoffs: first the row player’s, then the column player’s. Name the strategies on the edges and add up to five for each player.
| Row player ↓ / Column player → | ||
|---|---|---|
Results
Best responses
| Row player ↓ / Column player → | Cooperate | Defect |
|---|---|---|
| Cooperate | 3, 3 | 0, 5 |
| Defect | 5, 0 | 1, 1 (Nash equilibrium) |
A payoff is underlined when it is the best that player can get against the other’s choice. A shaded cell has both payoffs underlined: neither player wants to switch, so it is a Nash equilibrium. Ties count as best responses.
Pure-strategy Nash equilibria
Defect, Defect
Payoffs 1 and 1
The equilibrium (Defect, Defect) is not the best outcome for the players: both would be strictly better off at Cooperate, Cooperate.
Dominant strategies
Row player has a strictly dominant strategy, Defect: it is better than every alternative whatever the other player does.
Column player has a strictly dominant strategy, Defect: it is better than every alternative whatever the other player does.
Removing strictly dominated strategies one after another leaves a single outcome, (Defect, Defect), so the game is dominance solvable.
Mixed-strategy equilibrium
There is no equilibrium in which both players randomize between their two strategies.
How to Use the Nash Equilibrium Calculator
- 1. Set up the game. Name the two players and the strategies on the edges of the matrix, then add or remove strategies. Or pick one of the five classic games from the example list.
- 2. Enter the payoffs. Each cell holds two numbers: the row player's payoff first, the column player's second. Negative numbers are fine, and so are decimals.
- 3. Read the best-response table. A payoff is underlined when it is the best that player can get against the other's choice. A shaded cell has both payoffs underlined: that is a pure-strategy Nash equilibrium.
- 4. Check dominance and mixing. Below the table are the dominant strategies, the result of removing strictly dominated strategies in turn, and, for a 2×2 game, the mixed equilibrium.
What a Nash Equilibrium Is
A Nash equilibrium is a set of strategies, one per player, in which no player can do better by changing only their own strategy. Each strategy is a best response to the others. It is named for John Nash, who proved in 1950 that every finite game has at least one equilibrium, provided players are allowed to randomize.
To find the pure-strategy equilibria of a matrix by hand, use the best-response method: for each column, underline the row player's highest payoff, and for each row, underline the column player's highest payoff. Any cell with both numbers underlined is an equilibrium. If two strategies tie for best, underline both. That is exactly what the table above does.
Worked Example: The Prisoner's Dilemma
The calculator opens with the prisoner's dilemma, with payoffs written as higher-is-better scores. The row player's payoff comes first.
| Cooperate | Defect | |
|---|---|---|
| Cooperate | 3, 3 | 0, 5 |
| Defect | 5, 0 | 1, 1 |
Whatever the column player does, the row player scores more by defecting: 5 beats 3 against Cooperate, and 1 beats 0 against Defect. Defect is a strictly dominant strategy, and the same holds for the column player, so (Defect, Defect) is the only equilibrium, with payoffs 1 and 1. Both players would do strictly better at (Cooperate, Cooperate), which gives 3 each. The equilibrium is stable but not efficient, which is the point of the example, and the calculator flags it.
Dominance and Elimination
A strategy is strictly dominated when another strategy gives the player a strictly higher payoff against everything the opponent might do. No rational player uses a strictly dominated strategy, so it can be deleted, and deleting it may make a strategy of the opponent's dominated in the smaller game. The calculator repeats this until nothing more can go. If one cell is left, the game is dominance solvable and that cell is the equilibrium. Dominance by a mixture of strategies is not checked, so a strategy that looks undominated here can still be dominated by a randomization.
Mixed Equilibria in 2×2 Games
Some games, such as matching pennies, have no pure equilibrium at all. A player then randomizes, and the equilibrium probabilities follow the indifference principle: each player mixes so that the other is indifferent between their two strategies. In the battle of the sexes, with payoffs (2, 1) for both on Opera, (1, 2) for both on Football and 0 for a mismatch, the row player's chance of Opera must make the column player indifferent. Solving gives Opera with probability 2/3 for the row player and 1/3 for the column player, and each expects 2/3, less than either would get from coordinating on a pure equilibrium.
The calculator finds a mixed equilibrium only for 2×2 games. A larger game may have mixed equilibria too, including ones where players use only some of their strategies, which are not calculated here. A game with a strictly dominant strategy has no equilibrium in which that player mixes, so the calculator reports none.
Frequently Asked Questions
- How do you find a Nash equilibrium in a payoff matrix?
- For each column, mark the row player's best payoff; for each row, mark the column player's best payoff. A cell where both payoffs are marked is a pure-strategy Nash equilibrium, because neither player gains by switching. If no cell has both marks, look for a mixed equilibrium.
- Can a game have more than one Nash equilibrium?
- Yes. Coordination games like the stag hunt and the battle of the sexes have two pure equilibria and a mixed one. Theory alone cannot say which will be played, so economists add ideas such as payoff dominance or risk dominance to choose between them.
- Does every game have a Nash equilibrium?
- Every finite game does, if players may randomize. That is Nash's 1950 existence theorem. Matching pennies has no equilibrium in pure strategies, but it has one in which both players pick each side half the time.
- What is the difference between a dominant strategy and a Nash equilibrium?
- A dominant strategy is best whatever the other player does. A Nash equilibrium only requires each strategy to be best against the other's equilibrium strategy. If every player has a dominant strategy, the combination is a Nash equilibrium, but many games have equilibria without any dominant strategy.
- Why is the prisoner's dilemma outcome bad if it is an equilibrium?
- Equilibrium means no one can gain by changing alone, not that the outcome is best for the group. In the dilemma, each player's own best choice leads to a result that leaves both worse off than mutual cooperation. Repetition, communication or enforceable agreements can change the incentives.
- How do I calculate a mixed-strategy equilibrium?
- Let the row player choose their first strategy with probability p. Set the column player's expected payoffs from their two strategies equal and solve for p, then do the same for the column player using the row player's payoffs. Both probabilities must lie strictly between 0 and 1, or there is no equilibrium in which both mix.