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.

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.