Soccer Expected Goals (xG) Calculator

Estimate the xG value of a shot based on position and type.

Input shot distance from goal, angle to the posts, body part, and whether it was assisted to estimate expected goals (xG) using a logistic-regression model in the style of public Opta and StatsBomb shot data. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is expected goals (xG)?

Expected goals (xG) is a metric that assigns each shot a probability of scoring between 0 and 1, based on historical data from similar shots. A shot worth 0.3 xG means an average player would score it roughly 30 percent of the time from that position and situation.

Soccer Expected Goals (xG) Calculator

Expected goals (xG) is the most important shot-quality metric in modern football analytics. It converts the location and context of a shot into a scoring probability between 0 and 1. This calculator uses a simplified logistic-regression model to estimate xG from distance, angle, body part, and assist type.

How it works

The dominant geometric driver of xG is the shot angle — the angle subtended at the ball by the two goalposts. With a standard 7.32 m goal, the angle is computed from the shooter’s distance d straight out from goal and horizontal offset x from the goal centre. The model forms a linear score and passes it through the logistic function:

half = 7.32 / 2
angle = atan2(half - x, d) + atan2(half + x, d)
z = b0 + bDist * d + bAngle * angle + adjustments
xG = 1 / (1 + e^(-z))

Distance has a negative coefficient (farther shots are worth less) and angle has a positive coefficient (wider sight of goal raises xG). Headers and one-touch shots from crosses apply negative adjustments, reflecting their lower historical conversion.

Example and notes

A penalty-spot shot (about 11 m out, directly central) opens a wide angle and produces an xG around 0.20-0.25 for an open-play strike. A close-range tap-in from 4 m sits near 0.5-0.7, while a long-range effort from 28 m central drops below 0.05.

Tips: the relationship between distance and xG is steep and non-linear because of the logistic curve — moving from 16 m to 10 m raises xG far more than moving from 30 m to 24 m. Use xG to judge chance quality over a match rather than relying on raw shot counts, since ten low-quality shots can be worth less than one excellent chance.

Understanding shot geometry

The angle calculation makes explicit what every striker knows intuitively: the further out or wider you are, the smaller the visible target.

From directly in front of goal at 10 m, the goalkeeper defends a full 7.32 m of horizontal space. At 10 m but shifted 4 m sideways to the right, the near post blocks part of that view and the angle to the far post tightens considerably. At the byline, even 2 m from goal, the sight of the net is a sliver — which is why cut-backs are so dangerous: they give the receiver a central, wide-angle opportunity that the original wide position never had.

Worked examples

Central penalty-spot shot (11 m out, 0 m lateral offset, foot shot, no cross): The shooter faces almost the maximum possible goal angle from that range. A simplified model in the style used here returns approximately 0.20–0.25 xG — representing a 20–25% chance of scoring on average for a professional player. In real match data, penalties sit around 0.76 xG because they are taken without goalkeeper starting position variation, which commercial models capture.

Cross-assisted header from 8 m (4 m lateral offset, header): Close range compensates for the header’s lower conversion, but the lateral offset reduces the visible goal. A shot like this might return 0.15–0.20 xG — a good chance, but noticeably below a central foot shot from the same distance.

Long-range strike from 28 m (central, foot shot): Distance dominates. The logistic curve compresses shots from outside the box sharply toward zero — typically below 0.05 xG. This is why long-range goals feel exceptional: the base rate is low, so scoring from there beats expectation dramatically.

How analysts use xG in practice

Over-performance and under-performance: If a team creates 2.8 xG per match but scores only 1.5 goals on average over ten games, they are under-performing their expected output. Over a large sample this most commonly reflects poor finishing or goalkeeper quality, not an unlucky run — which makes xG a better predictor of future performance than actual goals scored.

Single-game context: One game is a tiny sample. A team can lose 1–0 while generating 2.3 xG to their opponent’s 0.4 — which tells a very different story from the scoreline. Following xG alongside the score gives a richer read on who controlled the quality of chances.

Team vs individual xG: Summing xG across all a team’s shots gives the team’s total expected output. Looking at individual shot takers reveals who takes on good chances (high average xG per shot) versus who takes many speculative attempts (low average xG per shot but high volume).

Limitations of this model

Commercial models from Opta, StatsBomb, and similar providers use dozens of features: goalkeeper starting position, number of defenders between the shooter and goal, speed of the attacking move, body positioning, and historical outcome data from hundreds of thousands of shots. This calculator uses the dominant geometric features — distance and angle — which account for the majority of the variance, but the results for specific situations may differ from professional figures. Use it to understand the principles and to compare shots against each other rather than as an absolute percentage.