In one sentence
Expected goals (xG) is the probability that a shot becomes a goal, estimated from thousands of similar past shots, and summed to measure the quality of chances a team creates.
How it works
Goals are rare and luck plays a big part: a team can dominate and lose 1-0. xG looks past the scoreline to the chances. A penalty is worth about three-quarters of a goal; a speculative 30-yard shot might be worth 0.03.
Each shot's value comes from a model, usually logistic regression or gradient boosting, trained on past shots. Inputs include distance, angle, body part, type of assist and whether it was a set piece. Richer versions add defender positions and goalkeeper location.
For betting, xG totals over several matches are a steadier guide to attacking and defensive strength than goals, and they feed goal models that price over/under and match odds.
The maths
- x_1 to x_k: shot features such as distance, angle and header or foot.
- β values: weights learned from historical shots.
- xG_team: expected goals from all the team's shots.
- The product term: the chance every shot misses, assuming shots are independent.
In words: each shot gets a scoring probability from its features, and adding them up tells you how many goals the chances were worth.
Worked betting example
Part one, a single match. A team takes five shots worth 0.76 (penalty), 0.12, 0.05, 0.31 and 0.08.
- Team xG = 0.76 + 0.12 + 0.05 + 0.31 + 0.08 = 1.32.
- Chance of scoring at least once = 1 − (0.24 × 0.88 × 0.95 × 0.69 × 0.92) ≈ 87.3%.
Part two, pricing. From recent xG form, you estimate the home side will generate 1.55 expected goals and the away side 1.15.
- Total expected goals λ = 2.70. Treating goals as Poisson, P(3 or more goals) ≈ 50.6%. Fair price for over 2.5 ≈ 1.97.
- Betfair offers 2.10 on over 2.5. £10 stake, 2% commission: a win pays £11 × 0.98 = £10.78. EV ≈ 0.506 × £10.78 − 0.494 × £10 ≈ +£0.51.
A small edge like this can vanish with a modest error in either team's xG estimate.
Where it's good
- Rating teams early in a season when goal tallies are dominated by luck.
- Spotting teams whose results outrun their chances, a common sign of regression to come.
- Feeding Poisson and Dixon-Coles models with steadier attack and defence inputs.
- In-play, judging whether a scoreline reflects the run of play.
- Player scorer markets, where shot volume and quality matter more than recent goals.
Limitations and pitfalls
- Different providers give different xG for the same shot; do not mix sources.
- Basic models ignore defender and keeper positions, so they undervalue open goals and overvalue crowded shots.
- xG ignores chances with no shot, such as a cross that just evades a striker.
- Finishing skill exists for some elite players, but it is small and hard to prove from limited shots.
- Game state distorts xG: a team leading 2-0 may sit back and concede many low-value shots.
- xG is now mainstream and bookmakers and exchange traders use it, so obvious xG-versus-goals gaps are often already priced.
- Summing independent shot probabilities misstates rebounds; many models group shots from the same move.
How to build it
- Python: scikit-learn or lightgbm for the shot model, statsmodels for logistic regression; mplsoccer for plotting.
- Data: event data with shot locations and types, from providers such as StatsBomb (some free open data) or Opta.
- Check calibration: across all shots rated around 0.10, about 10% should be goals.
- Tip: use rolling, time-weighted xG for and against, and blend with actual goals rather than discarding them.
Related methods
- Logistic regression: the classic way to build a shot model.
- Poisson distribution: turns xG into scoreline probabilities.
- Dixon-Coles model: a full scoreline model that can use xG inputs.
- Gradient boosting: a common modern shot model.
- Pi-ratings: can be driven by xG difference instead of goals.