Last updated: August 5, 2026
Prisoner's Dilemma Calculator
Creators
Dharmendra SinghReviewers

Creators
Dharmendra SinghReviewers
Quick Answer
The Prisoner's Dilemma Calculator computes each player's payoff from a T-R-P-S matrix based on their cooperate/defect choices, checks whether the matrix satisfies the classic dilemma conditions (T > R > P > S and 2R > T + S), and explains why mutual defection is the game's stable Nash equilibrium.
In the Prisoner's Dilemma, both players defecting is the stable outcome, even though both cooperating would have been better for everyone.
Key Takeaways
- The four payoffs are Temptation (T), Reward (R), Punishment (P), and Sucker (S), with T > R > P > S defining a true dilemma.
- Mutual defection is the unique Nash equilibrium, even though mutual cooperation gives a better combined outcome.
- The condition 2R > T + S ensures steady cooperation beats alternating exploitation over repeated rounds.
- Defection weakly dominates cooperation for each player individually, regardless of the other's choice.
- Repeated games can sustain cooperation through strategies like tit-for-tat, unlike single-round play.
Creators
Dharmendra SinghReviewers

Creators
Dharmendra SinghReviewers
Formula
payoff(D,C) = T, payoff(C,C) = R, payoff(D,D) = P, payoff(C,D) = S; a valid dilemma requires T > R > P > S and 2R > T + S
Where:
- T=Temptation payoff (defect vs. cooperate)
- R=Reward payoff (mutual cooperation)
- P=Punishment payoff (mutual defection)
- S=Sucker payoff (cooperate vs. defect)
Watch & Learn
An accessible introduction to the prisoner's dilemma payoff matrix, dominant strategies, and why rational self-interest can produce a worse outcome for both players.
Worked Examples
Classic payoff matrix, both defect
The textbook 5-3-1-0 payoff structure with both players defecting, the Nash equilibrium outcome.
- 1Both players choose defect, so look up payoff(D,D) = P.
- 2P = 1, so both players score 1.
- 3Check the dilemma condition: 5 > 3 > 1 > 0 and 2(3) = 6 > 5 + 0 = 5, both hold.
- 4Result: payoffA = 1, payoffB = 1, this is a valid dilemma.
One player exploits a cooperator
Player A defects while Player B cooperates, showing the temptation payoff in action.
- 1Player A defects against a cooperator, so A receives the temptation payoff T = 5.
- 2Player B cooperates against a defector, so B receives the sucker payoff S = 0.
- 3Result: payoffA = 5, payoffB = 0.
Mutual cooperation
Both players cooperate, producing the best joint outcome even though it is not the Nash equilibrium.
- 1Both players cooperate, so look up payoff(C,C) = R.
- 2R = 3, higher than the mutual-defection payoff of 1.
- 3Result: payoffA = 3, payoffB = 3, though this outcome is unstable without trust or repeated play.
Introduction
The Prisoner's Dilemma Calculator models the most famous scenario in game theory: two players each choose to cooperate or defect, and the payoff each receives depends on both choices. This tool lets students, economics learners, and strategy enthusiasts plug in a payoff matrix, pick each player's move, and instantly see the resulting scores, whether the matrix satisfies the classic dilemma conditions, and why mutual defection is the game's stable Nash equilibrium even though mutual cooperation would serve both players better.

What is the Prisoner's Dilemma?
The Prisoner's Dilemma is a foundational game theory scenario where two independent players simultaneously choose to cooperate or defect, without knowing the other's choice. Each combination of choices produces a payoff for both players, defined by four values: T (temptation), R (reward), P (punishment), and S (sucker).
Two players, two choices each: cooperate or defect.
Four possible outcomes, each with its own payoff pair.
Payoffs are set in advance and known to both players.
How the payoff formula works
Each outcome maps to one of four payoffs. If you defect while the other cooperates, you get the temptation payoff T, the best possible outcome for you individually. If you cooperate while the other defects, you get the sucker payoff S, the worst outcome. Mutual cooperation gives both players the reward R, and mutual defection gives both the punishment P.
payoff(defect, cooperate) = T — you exploit the other player.
payoff(cooperate, cooperate) = R — mutual benefit.
payoff(defect, defect) = P — mutual harm.
payoff(cooperate, defect) = S — you are exploited.
Using the inputs correctly
Set the four payoff values first, then choose each player's strategy. For the scenario to be a genuine Prisoner's Dilemma, the payoffs must satisfy T > R > P > S, and 2R must exceed T + S so that mutual cooperation beats alternating exploitation.
Enter T, R, P, S as any finite numbers.
Pick cooperate or defect independently for each player.
Check the isValidDilemma output to confirm the ordering holds.
Reading the outputs
The calculator reports each player's payoff based on the chosen strategies, whether the payoff structure is a valid dilemma, and a plain-language description of the Nash equilibrium — the outcome neither player can improve by unilaterally changing their choice.
- payoffA / payoffB:
the score each player receives.
- isValidDilemma:
whether T > R > P > S and 2R > T + S both hold.
- nashEquilibrium:
a description of the stable outcome (mutual defection).
A dependable step-by-step workflow
Following these four steps mirrors exactly how the calculator processes a scenario.
Set the payoff values for T, R, P, and S.
Pick each player's strategy.
Read the payoff matrix cell that matches both choices.
Check whether mutual defection is the stable equilibrium.
Common mistakes and how to avoid them
A common misunderstanding is assuming cooperation is individually 'rational' — in a single-round game, defection always weakly dominates for each player regardless of what the other does, which is exactly what makes it a dilemma.
Don't confuse the best joint outcome (mutual cooperation) with the Nash equilibrium (mutual defection).
Remember payoffs must satisfy T > R > P > S to be a true dilemma.
Don't forget the 2R > T + S condition, which rules out alternating exploitation being better than steady cooperation.
Where the Prisoner's Dilemma shows up
This model explains real-world situations from price wars between competing businesses to arms races between nations, and it is a cornerstone of evolutionary biology, political science, and behavioral economics.
Oligopoly pricing decisions between competing firms.
Climate change cooperation between countries.
Evolutionary biology models of cooperation and altruism.
Repeated games and the emergence of tit-for-tat strategies.
Reference patterns to remember
The classic textbook payoff values make a useful reference point for building your own scenarios.
The classic values are T=5, R=3, P=1, S=0.
Any values satisfying T > R > P > S and 2R > T+S form a valid dilemma.
Repeated play can shift outcomes toward cooperation through strategies like tit-for-tat.
| Outcome | Player A | Player B |
|---|---|---|
| Both cooperate | R | R |
| A defects, B cooperates | T | S |
| A cooperates, B defects | S | T |
| Both defect | P | P |
Quick Reference Card
Prisoner's Dilemma Cheat Sheet
Quick reference • Prisoner's Dilemma Calculator
T > R > P > S and 2R > T + SValid range: Any finite payoff values satisfying the ordering above
Common Values
⚠ Watch Out
- •Mutual cooperation is not the Nash equilibrium, despite being the better joint outcome.
- •The dilemma requires 2R > T + S, not just T > R > P > S alone.
- •Single-round dilemmas differ sharply from repeated ones.
- •Check domain restrictions before trusting the final value.
Pro Tips
- →Use tit-for-tat style reasoning when modeling repeated interactions.
- →Always verify both dilemma conditions before drawing conclusions.
- →Compare payoffs to real-world incentives to sanity-check your matrix.
- →Estimate the answer mentally first so large errors stand out.
FAQs
Why is mutual defection the Nash equilibrium?
Regardless of what the other player does, defecting always gives you an equal or better payoff than cooperating (T > R and P > S). Since this holds for both players, neither can improve their outcome by unilaterally switching, making mutual defection the stable equilibrium.
If cooperation is better for both, why don't players cooperate?
In a single, non-repeated game, there is no mechanism to enforce trust. Each player fears the other will defect and exploit them, so both rationally choose to defect, even though mutual cooperation would have produced a better combined outcome.
What conditions make a payoff matrix a true Prisoner's Dilemma?
The payoffs must satisfy T > R > P > S (temptation beats reward beats punishment beats sucker), and additionally 2R > T + S, ensuring steady cooperation outperforms alternating between exploiting and being exploited.
Does repeated play change the outcome?
Yes. In repeated games, strategies like tit-for-tat can sustain cooperation because players can punish defection in future rounds, changing the incentive structure compared to a single one-shot game.
What do T, R, P, and S stand for?
T is Temptation (defect against a cooperator), R is Reward (mutual cooperation), P is Punishment (mutual defection), and S is Sucker (cooperate against a defector) — standard game theory notation.
Can the payoffs be negative or use any scale?
Yes, any finite numeric payoffs work as long as they preserve the required ordering T > R > P > S and the 2R > T + S condition; the specific units or scale don't affect the underlying game structure.
Is the Prisoner's Dilemma only about literal prisoners?
No, it's a general model for any situation where individual incentives to defect conflict with the group's best interest, including business competition, environmental policy, and international relations.