A league table looks like simple arithmetic and is not. Points are trivial; the ordering rules underneath vary by competition and are the reason two tables built from identical results can legitimately disagree.
The points, and then the tiebreakers
- Points: 3 for a win, 1 for a draw, 0 for a loss (near-universal since the 1990s).
- Premier League and most European leagues: goal difference, then goals scored.
- La Liga: head-to-head record first, before goal difference.
- Serie A: head-to-head, then a mini-league among tied teams.
- UEFA group stages: head-to-head points, then head-to-head goal difference.
Worked example
Two teams finish on 70 points. Team A has +30 goal difference; Team B has +25 but won both head-to-head meetings. In the Premier League, Team A finishes above. In La Liga, Team B does. Neither table is wrong — the competitions genuinely rank differently, and a generator that hard-codes goal difference will silently produce a table that no competition actually uses.
What breaks in practice
Beyond tiebreakers: points deductions for insolvency or financial breaches, matches awarded 3–0 after an abandonment, and expunged records when a club folds mid-season. Any of these makes a table computed purely from played results disagree with the official one. If your table must match a published standing, take the published standing.
Doing this at scale
Computing a table from results is fine for a private model and risky for anything user-facing. Stats API publishes official standings per season, including points, goal difference and form, so you are reading the competition's own ranking rather than reimplementing its rulebook.
Common questions
Why does my table differ from the official one?
Most often a points deduction, an awarded result, or a tiebreaker that is head-to-head rather than goal difference. All three are invisible if you only have match scores.
Should I compute standings or fetch them?
Fetch them for anything users see. Compute them only when you are deliberately modelling a hypothetical, such as a projected final table.