The Expected Goals (xG) Calculator estimates chance quality from shot data to evaluate team performance and player finishing over time.
Expected Goals (xG) Calculator
Example Presets
Report an issue
Spotted a wrong result, broken field, or typo? Tell us below and we’ll fix it fast.
Expected Goals (xG) Calculator Explained
Expected Goals estimates the likelihood of scoring from a specific shot. Each shot receives an xG value, such as 0.05 for a long-range attempt or 0.75 for a one-on-one. Summed over a match or season, xG shows how many goals a team could reasonably expect to score from the chances they created.
Unlike raw shot counts, xG accounts for shot quality. A header from a tight angle is not equal to a central shot from 10 meters. By modeling historical outcomes, the calculator turns location and context into a probability that is easier to compare across players and teams.
Use xG to evaluate finishing, chance creation, and defensive performance. For finishing, compare actual goals to xG to see who over- or under-performs. For chance creation, track players who consistently produce high-xG opportunities through through balls, cutbacks, or smart crossing.

How the Expected Goals (xG) Method Works
The method links descriptive features of a shot to its observed outcome. A model learns from many past shots and returns a probability for a new shot. This probability is xG. The features capture location, angle, body part, play type, defensive pressure, and other contextual factors.
- Shot location: distance to goal center and lateral position on the pitch.
- Shot angle: the angle between the shot location and the two goalposts; wider angles are generally better.
- Body part: footed shots, headers, and volleys have different base odds.
- Situation: open play, set piece, counterattack, rebound, or penalty.
- Assist type: through ball, cutback, cross, dribble, or no assist.
- Defensive context: pressure level, number of defenders, and goalkeeper position if available.
The model is calibrated so that an xG of 0.20 yields a goal about 20% of the time in the long run. Reliability grows with sample size. Single-shots vary, but across many shots the probabilities align with actual outcomes.
Equations Used by the Expected Goals (xG) Calculator
The calculator applies standard probabilistic modeling. Most xG models use a logistic function, which maps feature inputs to a 0–1 probability. Auxiliary geometry links pitch coordinates to distance and angle features.
- Logistic probability: p(goal) = 1 / (1 + exp(-(β0 + β1×1 + β2×2 + … + βkxk))).
- Distance to goal center: d = sqrt((x – xg)^2 + (y – yg)^2), where (xg, yg) is goal center.
- Shot angle: θ = 2 × arctan(w / (2r)), where w is goal width and r is perpendicular distance from the shot to the goal line.
- Match xG total: Team xG = Σ p_i over all shots i; Non-penalty xG (npxG) excludes penalties.
- Rate metrics: xG per 90 = (Σ p_i / minutes played) × 90; xG difference = For xG − Against xG.
Different implementations may add interaction terms or non-linear learners, such as gradient boosting. The calculator remains transparent by showing inputs, the model shape, and the resulting probabilities for each shot.
Inputs, Assumptions & Parameters
The calculator needs precise inputs to estimate shot quality. It blends geometric features with contextual tags from event data. When available, richer context such as goalkeeper positioning and pressure improves accuracy.
- Shot distance: linear distance from shot location to the goal center (accepts m or yd).
- Shot angle: angle to the posts from the shooting spot (degrees or radians).
- Body part: foot (left/right) or header; volleys and weak-foot tags if known.
- Play type: open play, set piece, counterattack, rebound, or penalty.
- Assist type: through ball, cutback, cross, dribble, or no assist.
- Pressure: none, light, medium, heavy; optional goalkeeper distance off the line.
Inputs must fall within realistic ranges, such as angles from 0° to about 180° and distances within the pitch. The calculator flags edge cases like zero distance, negative angles, or impossible coordinates. If a field is missing, the model uses defaults based on historical averages for that context.
Using the Expected Goals (xG) Calculator: A Walkthrough
Here’s a concise overview before we dive into the key points:
- Select the competition rules and pitch dimensions that match your data source.
- Enter the shot location or distance and angle; the tool will compute missing geometry if coordinates are provided.
- Choose body part and play type, then select an assist type if applicable.
- Set defensive pressure and goalkeeper position if those observations are available.
- Review the calculated xG for the shot; add it to a match timeline if desired.
- Repeat for each shot to build a team or player xG total.
These points provide quick orientation—use them alongside the full explanations in this page.
Example Scenarios
A winger cuts the ball back to a striker 10 meters from goal, slightly left of center. Angle is moderate, body part is right foot, and pressure is light. Entering these into the calculator returns xG ≈ 0.35. With three similar chances in a match, total xG would be about 1.05. What this means — the team created enough to score about one goal, and the striker had a high-value chance.
A lofted cross finds a forward at six yards, but the header is at a tight angle, and two defenders contest the jump. Body part is header, assist type is cross, pressure is heavy. The calculator returns xG ≈ 0.12 for that attempt. If the same player later gets a one-on-one at 12 meters with the goalkeeper off the line, that shot might be xG ≈ 0.40, giving a personal match total of 0.52. What this means — the header was a low-probability chance; the one-on-one contributed most of the expected scoring.
Assumptions, Caveats & Edge Cases
No model sees everything. xG captures the typical effect of distance, angle, and context, but it cannot fully know shot power, swerve, or goalkeeper reaction. Still, across many shots the average is informative and fair for comparisons.
- Sample bias: training data quality and era affect probabilities; modern events differ from past seasons.
- Measurement error: small location errors can change angle and distance, especially near the goal.
- Model scope: pre-shot xG ignores shot placement; a separate post-shot model (xGOT) handles that.
- Penalties: often assigned a fixed xG around 0.76–0.79 based on long-run conversion rates.
- Game state: pressure and fatigue vary by minute and score; not all models adjust for this.
Use xG as context, not as destiny. A single miss on a 0.6 chance is normal. Over a season, however, xG totals guide tactical choices, recruitment, and performance reviews with stronger evidence than goal counts alone.
Units & Conversions
Consistent units make geometry and probabilities comparable across matches and leagues. The calculator accepts both metric and imperial inputs, then converts them internally so distance and angle features are coherent.
| Quantity | Conversion |
|---|---|
| Distance | 1 m = 1.094 yd; 1 yd = 0.9144 m |
| Angle | Degrees to radians: rad = deg × π / 180; radians to degrees: deg = rad × 180 / π |
| Speed (shot) | 1 km/h = 0.621 mph; 1 mph = 1.609 km/h |
| Time | 1 minute = 60 seconds; Per 90 scaling: value × 90 / minutes played |
| Probability | Decimal to percent: % = p × 100; Percent to decimal: p = % ÷ 100 |
Enter data in your preferred units. The calculator converts behind the scenes and reports xG as a probability or percent. For rate stats like xG per 90, confirm the minutes played so the scaling is correct.
Common Issues & Fixes
Most problems trace back to input precision or mismatched units. A small location error can shift the angle by several degrees near the goal, changing xG more than expected.
- If angles look extreme, verify shot coordinates and pitch origin conventions.
- When xG seems too high for headers, check the body part tag and assist type.
- For zero or negative distances, recheck coordinate orientation and field size.
If you lack pressure or goalkeeper data, choose “unknown” and let the defaults apply. Consistency across your dataset is more important than adding uncertain tags to a few shots.
FAQ about Expected Goals (xG) Calculator
How is xG different from goals and shots?
Goals are outcomes; shots are attempts; xG estimates the quality of each attempt. It predicts the average scoring probability based on context, not the actual result.
Can xG rate individual finishers?
Yes. Compare a player’s goals to their xG. Over many shots, consistent over-performance may indicate superior finishing or movement; under-performance can flag issues to review.
Does the calculator handle penalties and set pieces?
It treats penalties with a fixed or learned xG based on conversion history, and it distinguishes free kicks and corners from open play because their success rates differ.
What is npxG and why use it?
Non-penalty xG (npxG) excludes penalties to focus on open-play and set-piece chance quality. It helps compare teams or players with different penalty counts.
Key Terms in Expected Goals (xG)
Expected Goals (xG)
A probability from 0 to 1 that a shot results in a goal, learned from historical shot outcomes and contextual features.
Shot Distance
The straight-line distance from the shooting location to the goal center, typically measured in meters or yards.
Shot Angle
The angle between the shooter’s position and the two goalposts; wider angles generally mean a better scoring chance.
Body Part
Classification of the striking surface, such as left foot, right foot, or header; affects baseline scoring probability.
Assist Type
The pass or action that set up the shot, such as through ball, cutback, or cross; shapes how defenders and goalkeepers are positioned.
Pressure
A qualitative tag for defensive intensity on the shooter, from none to heavy; tends to reduce conversion odds.
Non-Penalty xG (npxG)
Total xG excluding penalties, used to assess chance creation outside of spot kicks.
xG per 90
A rate metric that scales a player’s or team’s xG to a 90-minute baseline for fair time-adjusted comparisons.
Sources & Further Reading
Here’s a concise overview before we dive into the key points:
- The Analyst: Expected Goals (xG) explained
- StatsBomb: What is Expected Goals (xG)?
- Opta/Stats Perform: What is xG?
- Friends of Tracking: Football analytics lectures and notebooks
- Karun Singh: Building an xG model from event data
- StatsBomb Open Data: Public soccer event and match files
These points provide quick orientation—use them alongside the full explanations in this page.