The World Cup has a scoring history with a clear, surprising shape. The early tournaments were goal-soaked free-for-alls; the modern game, for all its talent, is markedly stingier. Plotting goals per game by year reveals that arc in a single chart: the high-scoring 1950s, the defensive dip, the long plateau of the modern era. This tutorial draws that chart in Python with matplotlib. Just as importantly, it shows you how to source the underlying numbers honestly, rather than trusting a half-remembered figure or a chart with no citation.

The metric: goals per game

Total goals at a World Cup is the wrong number to compare across history, because the tournaments are different sizes. The 1930 edition played 18 matches; recent ones played 64; the 2026 tournament played 104. A tournament with more matches racks up more total goals almost by definition. The fair comparison is goals per game (total goals divided by total matches) which strips out tournament size and leaves a clean measure of how freely teams scored.

The format expansion is itself a story worth knowing: the jump to 48 teams and 104 matches is unpacked in why 104 matches and a 48-team format. For this chart, the takeaway is simply that you must normalise by matches, or 1930 and 2022 are not on speaking terms.

Sourcing the data honestly

This is the part most tutorials skip, and it is the most important. The goals-per-game figures are historical facts that live in well-maintained reference sources: principally the RSSSF archive and FIFA's own records. You should pull the full, authoritative series from one of those.

To keep this script runnable on its own, the code below seeds a handful of well-known anchor values (figures widely reported and useful as a sanity check) and explicitly leaves the rest for you to fill in from the source. Two honesty points follow from that, and they are not boilerplate:

Read this before trusting the numbers
The handful of values below are illustrative anchors, not a complete or official dataset. They are a starting scaffold. Replace and extend them with the full series from RSSSF or FIFA before drawing any conclusion. When this tutorial was first published on June 10, 2026, 2026 had no figure at all, because the tournament had not been played. It has now: the next section computes 2026 from our own match file instead of adding it to the anchor list, so the measured point and the anchors stay clearly apart.
import pandas as pd

# --- ILLUSTRATIVE ANCHORS ONLY -- NOT a complete/official dataset.
# A few widely-reported goals-per-game values to seed the chart and
# act as a sanity check. SOURCE THE FULL SERIES YOURSELF from RSSSF
# (https://www.rsssf.org/) or FIFA, and fill in every missing year.
# 2026 is not an anchor: the next section computes it from our match file.
goals_per_game = pd.DataFrame([
    # year, goals_per_game   (fill in the rest from the source!)
    (1930, 3.89),
    (1954, 5.38),   # the famous high-scoring outlier
    (1962, 2.78),
    (1990, 2.21),   # the famous low-scoring outlier
    (2014, 2.67),
    (2018, 2.64),
    (2022, 2.69),
], columns=["year", "goals_per_game"])

# TODO: add the years you are missing -- 1934, 1938, 1950, 1958,
# 1966, 1970, 1974, 1978, 1982, 1986, 1994, 1998, 2002, 2006, 2010 --
# using values from your chosen authoritative source.
print(goals_per_game)

If you want to compute these yourself rather than copy them, the arithmetic is trivial once you have each tournament's total goals and match count: goals divided by matches. RSSSF lists both per edition. Building the series from those two raw columns is the most defensible route, because then every point on your chart traces back to a primary count you can re-check.

Adding 2026 to the chart: 2.96 goals per game across all 104 World Cup matches

The 2026 World Cup finished on July 19, 2026, so the point this tutorial had to leave blank can now be filled. We did not add it to the anchor list. We computed it from our own match file, /data/wc2026_results.json: ESPN’s public scoreboard and match-summary feed, pulled on July 19, 2026, all 104 matches. Each score is the score after extra time. Penalty shoot-outs are not in it, so the 4 knockout games that ended level after extra time count the goals of their 120 minutes, not the shoot-out kicks. The file carries no stage labels, so the stage comes from kickoff order: the first 72 games are the group stage and the last 32 are the knockouts.

The 2026 number. 308 goals in 104 matches is 2.96 goals per game. For 2022 we use StatsBomb Open Data (the 2022 World Cup match file in StatsBomb’s open-data repository, all 64 matches, scores after extra time), a different provider counting the same thing: 172 goals in 64 matches, 2.69. That matches the 2022 anchor in the code above, the only one of the seven anchors we can check against data we hold. So 2026 scored 0.27 more goals per game than 2022.

Against the long run. We do not hold a sourced series for 1930 to 2018, so we cannot give a true long-run average here, and we will not quote one from memory. The closest figure on this page is the mean of the seven anchor values in the first code block, 3.18, and 2026 sits 0.22 below it. That mean is not a long-run average: the anchors are a hand-picked scaffold that includes the two highest-scoring early tournaments. What the anchors do show is where 2026 falls among them: above all five from 1962 on (1962, 1990, 2014, 2018, 2022) and below only 1930 and 1954 (3.89 and 5.38). To rank 2026 against every earlier tournament, you need the full series from RSSSF or FIFA.

World Cup goals per game, all matches and by stage, 2022 and 2026. Scores after extra time; shoot-out kicks not counted. Stage for 2026 from kickoff order (72 group games, 32 knockout games). Sources: 2026, ESPN public scoreboard and match-summary feeds (soccer/fifa.world), /data/wc2026_results.json, pulled July 19, 2026; 2022, StatsBomb Open Data (StatsBomb Public Data User Agreement).
World CupStageMatchesGoalsGoals per gameSource
2022All641722.69StatsBomb Open Data
2022Group481202.50StatsBomb Open Data
2022Knockout16523.25StatsBomb Open Data
2026All1043082.96ESPN, /data/wc2026_results.json
2026Group722152.99ESPN, /data/wc2026_results.json
2026Knockout32932.91ESPN, /data/wc2026_results.json

Group stage against knockouts. In 2026 the 72 group games produced 215 goals (2.99 a game) and the 32 knockout games 93 (2.91). In 2022 it ran the other way: 2.50 in the group stage (120 goals in 48) and 3.25 in the knockouts (52 in 16). Both knockout figures include extra-time goals, because that is how the scores are recorded. For 2022 we can take them out: StatsBomb’s shot file shows 5 knockout games went to extra time (all 5 then went to shoot-outs), with 4 goals scored in extra time. Without those, 2022’s knockouts still scored 3.00 a game, half a goal above its group stage. Our 2026 file has no goal minutes, so we cannot do the same there. Small samples move easily, too: the 2026 third-place match alone had 10 goals, and without it the 2026 knockouts drop to 2.68 a game.

Add it in code. Run this after the anchor block above. It reads the same served file, rebuilds the 2026 numbers and appends 2026 to goals_per_game, so the charts below pick it up:

import json
from urllib.request import urlopen

URL = "https://socceranalytics.net/data/wc2026_results.json"
with urlopen(URL) as resp:
    wc = json.load(resp)

# The file has no stage labels: in kickoff order, the first 72 games
# are the group stage and the last 32 are the knockouts.
games = sorted(wc["matches"], key=lambda m: (m["date"], m["id"]))
goals = [m["home_score"] + m["away_score"] for m in games]  # after extra time
group, knockout = goals[:72], goals[72:]

print(wc["retrieved"], len(games), "matches,", sum(goals), "goals")
print(f"all {sum(goals) / len(goals):.2f} | group {sum(group) / len(group):.2f}"
      f" | knockout {sum(knockout) / len(knockout):.2f}")

# Add 2026 to the series as a measured point, not an anchor.
row = pd.DataFrame({"year": [2026],
                    "goals_per_game": [round(sum(goals) / len(goals), 2)]})
goals_per_game = pd.concat([goals_per_game, row], ignore_index=True)
print(goals_per_game.tail(2))

We ran it against our copy of the same file, and it printed:

2026-07-19 104 matches, 308 goals
all 2.96 | group 2.99 | knockout 2.91
   year  goals_per_game
6  2022            2.69
7  2026            2.96
Two-panel chart. Left: World Cup goals per game by year. Hollow grey points are the tutorial's seven illustrative anchors (1930 3.89, 1954 5.38, 1962 2.78, 1990 2.21, 2014 2.67, 2018 2.64); a filled green point marks 2022 at 2.69, computed from StatsBomb; a gold point marks 2026 at 2.96, computed from our ESPN file; a dashed line marks the anchors' mean of 3.18, labelled as not a long-run average. Right: bars of group-stage and knockout goals per game, 2022 2.50 and 3.25, 2026 2.99 and 2.91.
2026 added to the chart: 2.96 goals a game across 104 matches, against 2.69 in 2022. Only 2022 and 2026 are computed from match data; the hollow points are this tutorial’s illustrative anchors. Data: ESPN public feed, /data/wc2026_results.json (pulled July 19, 2026); StatsBomb Open Data for 2022. Scores after extra time, shoot-outs excluded. Drawn by our analysis script.

Limits. Two providers: 2026 comes from ESPN and 2022 from StatsBomb. Both record the score after extra time without shoot-outs, so the totals compare like with like, but we have no third source to cross-check either. The 2026 stage split rests on kickoff order, because the file has no stage field. And 2026 had 48 teams against 32, which put more mismatched group games in the sample, so its group-stage rate is not a clean comparison with older tournaments. The 2026 total agrees with our closing update on 2026 scoring, which uses the same file.

Tidying the series

Whichever way you assemble it, a few tidy-up steps make the data plot-ready. Sort by year so the line runs left to right in time. Confirm the values are numeric, and, if you computed them, round sensibly. The point of doing this in pandas is that the same code works whether you have seven rows or the full two dozen.

goals_per_game = (goals_per_game
                  .sort_values("year")
                  .reset_index(drop=True))

# If you stored raw totals instead, derive the rate like this:
#   goals_per_game["goals_per_game"] = (
#       goals_per_game["total_goals"] / goals_per_game["total_matches"]
#   )

# Quick sanity bounds: World Cup scoring has historically sat
# between roughly 2 and 5.5 goals per game. Flag anything outside.
out_of_range = goals_per_game[
    (goals_per_game["goals_per_game"] < 1.5) |
    (goals_per_game["goals_per_game"] > 6.0)
]
if not out_of_range.empty:
    print("Check these unusual values:\n", out_of_range)

That range check is a cheap guard against the most common sourcing error: a transcribed total that is off by a tournament. Anything below 1.5 or above 6 goals per game across a whole World Cup would be historically unprecedented and almost certainly a typo.

Drawing the chart

Now the payoff. A line plot of goals per game against year shows the long arc directly. We mark each tournament with a point, label the axes, and draw a reference line at the all-time average so the high- and low-scoring eras read at a glance.

import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(9, 5))

ax.plot(goals_per_game["year"], goals_per_game["goals_per_game"],
        marker="o", color="#1f4e79", linewidth=2)

# Reference line: the mean across the years you have.
mean_gpg = goals_per_game["goals_per_game"].mean()
ax.axhline(mean_gpg, color="grey", linestyle="--", linewidth=1)
ax.text(goals_per_game["year"].min(), mean_gpg + 0.05,
        f"mean of plotted years ({mean_gpg:.2f})", color="grey")

ax.set_xlabel("World Cup year")
ax.set_ylabel("Goals per game")
ax.set_title("World Cup goals per game by year\n"
             "(illustrative anchors -- complete the series from RSSSF/FIFA)")
ax.set_ylim(0, 6)
fig.tight_layout()
plt.savefig("world_cup_goals_per_game.png", dpi=120)
plt.show()

The chart title carries the caveat into the image itself, so the figure can never be mistaken for a finished, fully-sourced dataset when it is screenshotted out of context. That is a small habit worth keeping for any chart built on partial data.

Annotating the eras

A bare line invites the question "so what?" Annotations answer it. With matplotlib's annotate you can point directly at the landmarks: the 1954 spike, still the highest-scoring World Cup on record, and the defensive trough around 1990, the lowest. The contrast between them frames the whole modern-era story: scoring fell sharply from the early decades and has since settled into a remarkably stable band.

# Annotate the two famous extremes (only if present in your data).
labels = {1954: "1954: highest on record",
          1990: "1990: defensive low"}

for year, text in labels.items():
    row = goals_per_game[goals_per_game["year"] == year]
    if not row.empty:
        y = float(row["goals_per_game"].iloc[0])
        ax.annotate(text, xy=(year, y),
                    xytext=(year, y + 0.6),
                    ha="center", fontsize=9,
                    arrowprops=dict(arrowstyle="->", color="black"))

fig.savefig("world_cup_goals_annotated.png", dpi=120)

Run the full script and you have a publishable chart of the long arc of World Cup scoring, once you have replaced the anchors with the complete series. The reason that arc bends the way it does (better defending, fitter athletes, tactical caution at the knockout stages) is the kind of question World Cup 2026 by the numbers takes up, setting recent tournaments against the historical baseline this chart makes visible.

Where this can mislead

Two honest caveats. First, goals per game is a tournament-wide average, and it hides structure. Group stages and knockouts can differ in either direction: in 2022 the knockouts scored more (3.25 a game against 2.50), in 2026 slightly fewer (2.91 against 2.99). And a single rout can lift a whole edition's figure. Second (the one this tutorial has hammered), a chart is only as trustworthy as its source. The anchors here are a scaffold to get the code running, not a dataset to cite. Pull the full series from RSSSF or FIFA, check it against the raw match counts, and only then read meaning into the shape. The 2026 point is the exception: it is computed from our own match file, above, not taken from the anchors.

Reproduce it

Every figure in the 2026 section (added November 5, 2026) comes from our analysis script. It reads data_layer/wc2026_results.json (ESPN, pulled July 19, 2026) through our archive loader, which assigns stages by kickoff order; reads the 2022 World Cup match file in StatsBomb’s open-data repository and its event files for 2022 and its extra-time goals; writes every number to data/stats/chart-a-century-of-world-cup-goals-python-2026.json; and draws the chart. No network, nothing hand-entered; the anchor values are copied from the first code block above and labelled as such.

Sources & further reading

  • 2026 section (added November 5, 2026): all 104 matches in /data/wc2026_results.json. ESPN public scoreboard and match-summary feeds (soccer/fifa.world), final, pulled July 19, 2026; scores after extra time, shoot-outs not counted.
  • 2022 comparison: the 2022 World Cup match file in StatsBomb’s open-data repository and its event files (StatsBomb Public Data User Agreement; data provided by StatsBomb), all 64 matches.
  • RSSSF: the Rec.Sport.Soccer Statistics Foundation, the standard archive for historical World Cup totals and match counts.
  • FIFA: official tournament records and statistics for every World Cup edition.
  • SciPy / NumPy documentation: reference for the numerical tooling behind pandas.
  • FBref: competition histories useful for cross-checking figures.

Published by SoccerAnalytics from public data and the sources named in this piece. How this site is made.