TSE.
MathematicsFinanceHealthPhysicsEngineeringSportsBrowse all

Sports & Gaming · Probability · Sports Analytics

Soccer Expected Goals (xG) Calculator

Calculate the Expected Goals (xG) value for a soccer shot based on distance, angle, shot type, and assist type using a logistic regression model.

Calculator

Advertisement

Formula

xG is the probability that a shot results in a goal. d = distance to goal (metres), θ = shot angle (degrees), S = shot type coefficient, A = assist type coefficient. The logistic function maps the linear predictor to a [0,1] probability. Coefficients are calibrated from StatsBomb open data analysis: β0 = 0.2, β1 = -0.08 (distance penalty), β2 = 0.03 (angle reward), β3 = shot-type offset, β4 = assist-type offset.

Source: Statsbomb Open Data (2019); Caley, M. — Expected Goals methodology; logistic regression approach per Rathke (2017) Journal of Human Kinetics.

How it works

The calculator uses a logistic regression model — the standard approach in professional soccer analytics — to convert shot characteristics into a probability between 0 and 1. The linear predictor is formed from the shot distance (in metres), the angular deviation from the centre of goal (in degrees), a shot-type offset, and an assist-type offset. This predictor is then fed into the logistic (sigmoid) function to constrain the output to a valid probability.

Distance is the dominant factor: shots from 6 m are far more dangerous than shots from 30 m. Angle matters too — a tight angle near the byline offers far fewer goal-scoring areas than a central position at the same distance. Shot type (header vs. foot, penalty, etc.) and assist type (through ball, cross, etc.) apply additive corrections based on empirical conversion-rate differences observed in large tracking datasets.

Professional clubs and data providers such as StatsBomb, Opta, and Wyscout build far more complex models that additionally incorporate goalkeeper position, defender pressure, body part used, and game-state variables. This calculator uses a simplified but analytically sound version suitable for educational use and quick assessments.

Worked example

Scenario: A central midfielder plays a through ball to a striker who takes a right-foot shot from 14 m directly in front of goal (0° angle).

Inputs: Distance = 14 m, Angle = 0°, Shot Type = Open Play foot (offset +0.3), Assist = Through ball (offset +0.2).

Step 1 — Linear predictor:
LP = 0.2 + (−0.08 × 14) + (0.03 × 0) + 0.3 + 0.2
LP = 0.2 − 1.12 + 0 + 0.3 + 0.2 = −0.42

Step 2 — Logistic function:
xG = 1 / (1 + e^(0.42)) = 1 / (1 + 1.522) ≈ 0.397

Interpretation: This shot has an xG of 0.40 — a high-quality chance. On average, approximately 2.5 such shots would be needed to score one goal. Missing this chance would represent underperformance relative to expectation.

Limitations & notes

This calculator uses a simplified logistic regression with fixed coefficients derived from aggregate data. Real-world xG models used by professional clubs incorporate dozens of additional features including goalkeeper positioning, defensive pressure index, the shooter's body orientation, whether the shot was first-time or controlled, and game-state context (score, minute, home/away). Penalty kicks are treated as fixed-value near-certain events (~0.76 xG) in professional models; our model approximates this. Very long-range shots (>35 m) or shots from impossible angles may require additional clamping not implemented here. xG is a probabilistic concept — high-xG chances can be missed and low-xG chances can be scored; the model is meaningful only over large sample sizes.

Frequently asked questions

What is a 'good' xG value for a single shot?

In professional soccer, the average shot has an xG of roughly 0.10–0.12. Shots above 0.25 are considered high-quality chances. A penalty is approximately 0.76 xG. Open-play headers typically average around 0.08–0.10 xG due to the difficulty of directing the ball precisely.

Why does shot angle matter so much for xG?

The angle determines how much of the goal mouth the shooter can actually target. From a 0° central position, the entire 7.32 m goal width is accessible. From a tight 80° angle near the byline, only a small sliver of the far post is available. This geometric reduction in target area directly reduces the probability of scoring.

How is cumulative team xG used to evaluate match performance?

Summing the xG values of every shot in a match gives team xG totals (e.g., 2.3 vs 0.8). A team that wins 1–0 despite conceding 2.3 xG likely got lucky, while a team that lost 0–1 despite generating 2.3 xG likely underperformed. Over a season, teams whose actual goal tallies consistently exceed their xG are often identified as clinical finishers or beneficiaries of variance.

Can xG be used to evaluate goalkeeper performance?

Yes — Post-Shot xG (PSxG) models additionally account for the shot's placement within the goal frame after the ball has left the foot. Comparing PSxG against actual goals conceded gives a 'Goals Saved Above Expected' (GSAx) metric, widely used to rank goalkeeper performance independently of the defensive unit in front of them.

Why do different data providers report different xG values for the same shot?

Every provider (Opta, StatsBomb, Wyscout, FBref) trains their own proprietary model on different datasets, with different feature sets and different regression techniques (logistic regression, random forests, neural networks). Models trained on different leagues or time periods also diverge. There is no single 'official' xG standard — the values should be compared only within the same provider's data.

What is the difference between xG and post-shot xG (PSxG)?

Pre-shot xG is calculated from information available before the shot is taken (position, context). Post-shot xG is recalculated after the shot based on where the ball is actually heading within the goal frame and how much spin/pace it carries. PSxG is a better predictor of whether this specific shot will score; pre-shot xG is better for evaluating the decision to shoot and the quality of chance creation.

Last updated: 2025-01-30 · Formula verified against primary sources.