# Elo Rating Calculator

> Computes the expected score of two players from their Elo ratings with the logistic formula E = 1/(1 + 10^((R_b − R_a)/400)) and the rating change of each after a win, draw or loss for a given K-factor.

- Calculator id: `elo-rating` · Category: Games & Betting Math (`gaming`) · Tool name: `calculate_elo_rating`
- Canonical page: https://tttkmbb.com/gaming/elo-rating · This document: https://tttkmbb.com/gaming/elo-rating.md · JSON definition: https://tttkmbb.com/gaming/elo-rating.json

## Purpose

Computes the expected score of two players from their Elo ratings with the logistic formula E = 1/(1 + 10^((R_b − R_a)/400)) and the rating change of each after a win, draw or loss for a given K-factor.

**Use when:** You want the win expectancy between two rated players or the new ratings after a result, for chess or any Elo-based ranking (games, sports, matchmaking).

**Do not use when:** The rating system uses a different scale or rating deviations (Glicko, TrueSkill), or you need ratings after a whole tournament with FIDE's rounding and 400-point rule. Mathematics only; not gambling advice.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `rating_a` | number |  | required | Current Elo rating of player A. (min 0, max 4000) |
| `rating_b` | number |  | required | Current Elo rating of player B (the opponent). (min 0, max 4000) |
| `result` | enum: a_wins \| draw \| b_wins |  | required | Outcome of the game from player A's point of view. |
| `k_factor` | number |  | optional, default 32 | Maximum rating change per game. FIDE uses 40 (new players and juniors), 20 (established) and 10 (rated 2400+); 32 is common in club and online systems. (min 1, max 200) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `expected_score_a` | number |  | E_a = 1/(1 + 10^((rating_b − rating_a)/400)). |
| `expected_score_b` | number |  | E_b = 1 − E_a. |
| `new_rating_a` | number |  | rating_a + k_factor × (S_a − E_a) with S_a = 1, 0.5 or 0. |
| `new_rating_b` | number |  | rating_b + k_factor × (S_b − E_b). |
| `change_a` | number |  | k_factor × (S_a − E_a). |
| `change_b` | number |  | k_factor × (S_b − E_b) = −change_a. |
| `win_probability_a_percent` | number | % | E_a × 100: A's expected score as a percentage (the win probability when draws are impossible). |

## Formula

`E_a = 1 / (1 + 10^((rating_b − rating_a) / 400)); E_b = 1 − E_a; new_rating_a = rating_a + k_factor × (S_a − E_a); new_rating_b = rating_b + k_factor × (S_b − E_b); S = 1 for a win, 0.5 for a draw, 0 for a loss`

Standard logistic Elo formula (Elo 1978) in which a 400-point difference gives the stronger player an expected score of about 0.91. FIDE reads E from a table and counts differences above 400 points as 400; both differ from this formula by at most a few hundredths of a rating point per game. Probability mathematics only; not gambling advice.

## Data Sources

- Elo rating system (Wikipedia) — https://en.wikipedia.org/wiki/Elo_rating_system (reference, retrieved 2026-09-24)
- FIDE Handbook – B.02 FIDE Rating Regulations (fide.com) — https://handbook.fide.com/ (standard, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/elo-rating?rating_a=…&rating_b=…&result=…`
- `POST https://tttkmbb.com/api/v1/calculate/elo-rating` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/elo-rating · OpenAPI operationId `calculate_elo_rating` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "elo-rating", "inputs": {…}}`

## Example

- 1500 beats 1600, K = 32: inputs `{"rating_a":1500,"rating_b":1600,"result":"a_wins","k_factor":32}` → `{"expected_score_a":0.3599,"expected_score_b":0.6401,"new_rating_a":1520.48,"new_rating_b":1579.52,"change_a":20.48,"change_b":-20.48,"win_probability_a_percent":35.99}`
- 2000 draws with 1800, K = 20: inputs `{"rating_a":2000,"rating_b":1800,"result":"draw","k_factor":20}` → `{"expected_score_a":0.7597,"change_a":-5.19,"new_rating_a":1994.81,"new_rating_b":1805.19}`

```
GET https://tttkmbb.com/api/v1/calculate/elo-rating?rating_a=1500&rating_b=1600&result=a_wins&k_factor=32
```

## Limitations

The rating system uses a different scale or rating deviations (Glicko, TrueSkill), or you need ratings after a whole tournament with FIDE's rounding and 400-point rule. Mathematics only; not gambling advice. Standard logistic Elo formula (Elo 1978) in which a 400-point difference gives the stronger player an expected score of about 0.91. FIDE reads E from a table and counts differences above 400 points as 400; both differ from this formula by at most a few hundredths of a rating point per game. Probability mathematics only; not gambling advice. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which K-factor should I use?**

The one your rating system prescribes: FIDE 40/20/10 by experience and rating, USCF a rating-dependent formula, many online chess and game servers 16–32. A larger K makes ratings move faster.

**Does the expected score equal the win probability?**

Only when draws cannot happen. In chess E_a = P(win) + ½·P(draw), so a 0.36 expected score can be, for example, 25 % wins and 22 % draws.

**Why is FIDE's published change slightly different?**

FIDE reads the expected score from a table rounded to two decimals, caps rating differences at 400 points and rounds the sum of a tournament's changes, so individual games can differ by a fraction of a point.

## Related

- [Bet Expected Value Calculator](https://tttkmbb.com/gaming/bet-expected-value.md) — Use the win expectancy as the probability estimate for a price on the game.
- [Probability of Two Events Calculator](https://tttkmbb.com/statistics/probability-of-events.md) — Combine win probabilities of several games.
- [Percentage Calculator](https://tttkmbb.com/math/percentage.md) — Percent arithmetic on scores and expectancies.
