Xgoals
xG Guide · Part 1 · Chapter 2

How xG is calculated

An xG model looks at a shot the moment before it is struck, compares it with a huge archive of past shots, and returns the share that ended in a goal. The inputs, and how they are weighed, are what make one model different from another.

Where the shot is taken from

Location matters more than anything else. Two numbers describe it: the distance to the goal and the angle, how much of the goal mouth the shooter can see. Close and central is good; far or wide is poor. Every model starts here.

the shotdistance 19 mangle 21°: the goal it can seegoal, 7.32 mpenalty area
the shotdistance 19 mangle 21°:the goal it can seegoal, 7.32 mpenalty area
A shot about 19 m out, 6 m to the right. The lime triangle is the angle the goal gives it; the dashed line its distance to the centre of the goal.

What else a model knows

In almost every model

Distance and angle; body part (foot or head: headers are scored far less often from the same place); situation (open play, counter-attack, corner, free kick, penalty).

In most modern models

The action before the shot (a cross, a through ball, a cutback, a rebound); whether the shot was first-time; how the attack developed.

In premium models only

Where the goalkeeper stands, how many defenders block the way, the pressure on the shooter and how clear the view of goal is. StatsBomb records every visible player at the moment of the shot; Opta's model uses keeper position, pressure and clarity among more than 20 inputs.

Keeper position can change a value a lot. In one published StatsBomb example, a shot worth about 0.30 in a basic model was worth about 0.65 once the model knew the goalkeeper was out of position.

distanceanglefoot or headsituationthe pass beforekeeper, defenders*the modeltrained on past shotsone number0 to 1* premium models only
distanceanglefoot or headsituationthe pass beforekeeper, defenders*the modeltrained on past shotsone number0 to 1* premium models only
What goes into a model and what comes out: one probability for each shot.

From inputs to a probability

Early models were logistic regressions: a formula with a weight for each input, first published in academic work in 1997. Modern providers use machine learning: Opta describes gradient-boosted trees (XGBoost) trained on about one million shots from 40 competitions; StatsBomb uses gradient-boosted trees with rules that keep the model sensible (for example, closer can never be worse); Understat says it uses a neural network trained on over 100,000 shots.

The model is trained on the past and then frozen. A shot today is valued by what similar shots did in the training data. Models are retrained from time to time, which is why the same shot can be worth a little more or less after an update.

What a model does not know

Questions

Is there a formula for xG?

Not one formula. Old models were simple regressions with a weight per input; today's are machine-learning models trained on hundreds of thousands of shots. Each provider has its own.

Does xG include the goalkeeper?

In premium models, the keeper's position is an input. The keeper's skill is not: that belongs to post-shot measures such as goals prevented.

Why is a header worth less than a shot from the same spot?

Headers are scored much less often. In StatsBomb's older data, foot shots in the six-yard box were scored about 40% of the time and headers under 25%.

Sources

  1. Opta Analyst: What is expected goals (xG)? · 2023
  2. Opta Analyst: Evolving expected goals (the 2022 model) · April 2022
  3. Hudl StatsBomb: Expected goals (xG) explained
  4. Hudl StatsBomb: Upgrading expected goals · May 2022
  5. Understat
  6. Bajons & Kook: expected goals models (arXiv) · 2025
  7. StatsBomb (Trainor): How do headers compare to shots? · 2013
  8. American Soccer Analysis: explanation of models

Checked 2026-10-28. Methods change: every figure here is dated to its source.

xG explains football; it is not a betting tip. 18+ · Please gamble responsibly.