Prisoners Dilemma Calculator

By: Calculator Grid

Prisoner's Dilemma Calculator

Build a symmetric 2×2 payoff matrix, test whether it is a true prisoner's dilemma, and identify dominant strategies, Nash equilibria, and the collective cost of non-cooperation.

Strict prisoner's dilemma Nash: Defect / Defect Social optimum: Cooperate / Cooperate Collective gap: 4 points

The startup example is valid and ready to export as a real XLSX workbook.

Payoff inputs

Use one consistent payoff scale. Higher numbers mean outcomes the players prefer more.

Strategic result

Predicted one-shot equilibrium
Defect / Defect

Defection is strictly dominant for both players, even though mutual cooperation gives each player a higher payoff.

Game classification
Strict prisoner's dilemma
Dominant strategy
Defect
Socially efficient outcome
Cooperate / Cooperate
Collective payoff gap
4 points
Canonical ordering: T > R > P > S is satisfied. The additional repeated-game condition 2R > T + S is also satisfied.
Defect / Defect is the only Nash equilibrium. The maximum joint payoff is 6 points, compared with 2 points at equilibrium.

Payoff matrix analysis

Each row is one action pair. A Nash equilibrium is an outcome where neither player can improve by changing action alone.

Player A Player B A payoff B payoff Joint payoff Nash equilibrium?
Cooperate Cooperate 3 3 6 No
Cooperate Defect 0 5 5 No
Defect Cooperate 5 0 5 No
Defect Defect 1 1 2 Yes
With T = 5, R = 3, P = 1, and S = 0, unilateral defection improves a player's payoff whether the other player cooperates or defects.

How to use the Prisoner's Dilemma Calculator

What this calculator does. This tool analyzes a symmetric, two-player, one-shot game in which each player can either cooperate or defect. It converts four payoff values into a complete payoff matrix, checks the standard prisoner's-dilemma ordering, identifies each player's best responses and dominant strategy, finds every pure-strategy Nash equilibrium, and compares equilibrium welfare with the highest available joint payoff. It is an analytical model, not a prediction of a particular person's ethics, psychology, or behavior.

When to use it. Use the calculator to check a classroom game-theory exercise, compare incentive structures in a negotiation or policy example, test whether a proposed payoff table truly has prisoner's-dilemma form, or show why individually rational choices can produce a collectively inferior outcome. The Stanford Encyclopedia of Philosophy's prisoner's-dilemma overview explains the underlying conflict between individual and group rationality in greater depth.

How to calculate. The calculator opens with the classic demonstration T = 5, R = 3, P = 1, and S = 0, so all results and the XLSX export are available immediately.

  1. Replace any of the four sample payoffs with values from your problem. Use the same scale for every field; higher values must represent more-preferred outcomes.
  2. Read the predicted equilibrium first, then compare it with the socially efficient outcome and the collective payoff gap.
  3. Review the payoff matrix. Rows marked “Yes” are pure-strategy Nash equilibria because neither player can gain by switching alone.
  4. Select Download Excel to export the current typed inputs, matrix, checks, and conclusions. Select Reset to clear the demonstration data. Reset intentionally disables export until all four required inputs are valid again.

Input guide. Temptation payoff (T) is the defector's payoff when the other player cooperates; enter a required finite number such as 5. Raising T strengthens the incentive to exploit a cooperator. Reward payoff (R) is each player's payoff under mutual cooperation; a typical value is 3. Raising R makes cooperation collectively more attractive. Punishment payoff (P) is each player's payoff under mutual defection; a typical value is 1. Raising P makes mutual defection less costly and can shrink the welfare loss. Sucker's payoff (S) is the cooperator's payoff against a defector; a typical value is 0. Raising S makes unilateral cooperation less damaging. Each field accepts ordinary signed decimals and properly grouped U.S.-style numbers, from – 1,000,000,000 to 1,000,000,000. Decimal commas and scientific notation are rejected rather than silently reinterpreted.

Output guide. Predicted one-shot equilibrium lists all pure-strategy Nash equilibria; the classic game returns Defect / Defect. Game classification states whether T > R > P > S holds. Dominant strategy reports whether one action beats the other against both possible opponent actions. Socially efficient outcome is the action pair with the greatest joint payoff. Collective payoff gap subtracts the best Nash-equilibrium joint payoff from the maximum joint payoff; zero means the best equilibrium is also welfare-maximizing. The summary pills repeat these live conclusions, while the matrix columns show both individual payoffs, their sum, and whether each row is an equilibrium.

Worked example. With T = 5, R = 3, P = 1, and S = 0, defecting yields 5 rather than 3 when the other player cooperates, and 1 rather than 0 when the other player defects. Defect is therefore strictly dominant for both players. The only Nash equilibrium is Defect / Defect, with a joint payoff of 1 + 1 = 2. Mutual cooperation produces 3 + 3 = 6, so the collective payoff gap is 6 – 2 = 4 points. The startup workbook records these same values in its Summary, Inputs, and Matrix Analysis sheets.

Learn more. Open Yale Courses provides a practical introduction to strategic thinking and dominated strategies. For repeated interaction, its lecture on cooperation and the grim-trigger strategy shows how a sufficiently valuable future can change incentives that appear fixed in a one-shot game.

Formula and interpretation

The symmetric payoff matrix is built directly from four values:

Cooperate / Cooperate = (R, R) Cooperate / Defect = (S, T) Defect / Cooperate = (T, S) Defect / Defect = (P, P)

A strict prisoner's dilemma has T > R > P > S. The first and last comparisons make defection strictly dominant: against cooperation, defecting returns T instead of R; against defection, defecting returns P instead of S. Yet R > P means both players would prefer mutual cooperation to mutual defection. Many treatments also use 2R > T + S when studying repeated games, because it makes sustained mutual cooperation better on average than alternating exploitation.

The calculator reports pure-strategy equilibria only. Mixed strategies are unnecessary in a strict prisoner's dilemma because defection is already a dominant pure strategy. When you enter values that do not satisfy the classic ordering, the tool still analyzes the resulting symmetric 2×2 game, but it labels the game accordingly rather than forcing a prisoner's-dilemma conclusion.

Common mistakes

  • Mixing costs and rewards. If lower numbers are better in your source problem, convert them to utility payoffs first or interpret comparisons in the opposite direction. This calculator assumes higher is better.
  • Using inconsistent scales. T, R, P, and S must measure the same concept for both players.
  • Calling every cooperation problem a prisoner's dilemma. Coordination, chicken, stag hunt, and zero-sum games have different best-response structures.
  • Confusing equilibrium with the best joint outcome. A Nash equilibrium is stable against unilateral deviations; it need not maximize total welfare.