Below is a .
How Is xG Calculated in Football?
![]() |
| xG uses historical shot data and factors such as shot location, distance, angle, defensive pressure and goalkeeper position to estimate scoring probability. |
Expected goals, commonly abbreviated as xG, has become one of the most widely used statistics in modern football analysis. But while many fans understand that xG measures the quality of scoring chances, a more detailed question often follows:
How is xG actually calculated?
An xG value is not simply a statistic based on whether a shot was close to the goal. It is produced by an expected goals model that uses historical shot data to estimate the probability that a particular attempt will result in a goal.
Depending on the provider, the model can consider factors such as shot location, distance from goal, shooting angle, body part, type of assist, defensive pressure, goalkeeper position and the positions of other players.
For example, a close-range shot directly in front of goal may receive an xG value of 0.60, while a long-range attempt from a difficult angle could receive an xG value of 0.03.
That means the first shot has an estimated 60% chance of becoming a goal in the model, while the second has an estimated 3% chance.
Let's break down exactly how this works.
What Does xG Mean in Football?
xG means expected goals.
It is a statistical measurement that estimates the probability of a shot resulting in a goal.
An xG value normally falls between 0 and 1:
- 0.01 xG = approximately a 1% scoring probability
- 0.10 xG = approximately a 10% scoring probability
- 0.25 xG = approximately a 25% scoring probability
- 0.50 xG = approximately a 50% scoring probability
- 0.80 xG = approximately an 80% scoring probability
- 1.00 xG = theoretically a 100% scoring probability
However, xG is a probability estimate rather than a prediction of what definitely will happen.
If a shot has 0.30 xG, it does not mean the player scores 30% of that goal. It means that historically, shots with comparable characteristics have resulted in goals roughly 30% of the time.
How Is xG Calculated?
The basic process can be simplified into four stages:
Historical shot data → identify shot characteristics → train an xG model → assign a probability to each shot.
Thousands or millions of historical shots can be used to determine which characteristics are associated with goals.
For every shot, the model can examine information such as:
- Where was the shot taken?
- How far was it from goal?
- What was the shooting angle?
- Was it a header or a shot with the foot?
- How did the player receive the ball?
- Was the shot created by a cross or through ball?
- Was it from open play or a set piece?
- Were defenders between the shooter and goal?
- Where was the goalkeeper?
- Was the shooter under pressure?
Different data companies use different models and therefore can assign different xG values to the same shot. FBref notes that xG models can use variables including shot location, body part, type of pass and the type of attacking situation.
Hudl StatsBomb similarly explains that traditional xG models commonly use distance, angle, body part and the type of assist or previous action, while more detailed models can include goalkeeper and defender positions.
1. Shot Location Is One of the Most Important Factors
The first major factor in xG calculation is where the shot is taken.
Generally, shots taken closer to the goal have a greater probability of being scored than shots taken from further away.
For example:
Shot A:
A striker shoots from six yards in front of goal.
Shot B:
A midfielder shoots from 30 yards.
Even if both attempts are hit toward the centre of the goal, the first chance would normally receive a much higher xG.
This is because historical data shows that close-range shots are converted more frequently.
Shot location is therefore one of the fundamental building blocks of an xG model.
2. Distance From Goal Matters
Distance is closely connected to shot location.
A shot from five metres is usually much more dangerous than a shot from 25 metres.
An xG model can therefore use the distance between the shooter and the goal as one of its variables.
For example:
| Shot | Approximate distance | Typical danger |
|---|---|---|
| Close-range finish | 5 yards | Very high |
| Penalty-area shot | 12 yards | High |
| Edge of box | 18 yards | Moderate |
| Long-range shot | 25+ yards | Usually low |
These are illustrative examples rather than universal xG values. The actual probability depends on the model and other circumstances surrounding the shot.
3. Shooting Angle Affects xG
Distance isn't the only spatial factor.
The angle from which the player shoots also matters.
A player shooting directly in front of goal generally has more of the goal available than a player shooting from near the corner of the penalty area.
Consider two shots from roughly the same distance:
- Shot A comes from directly in front of goal.
- Shot B comes from a tight angle near the byline.
Shot A would generally have a higher probability of becoming a goal.
This is why sophisticated xG models don't simply divide the pitch into areas. They can account for the precise relationship between the shooter and the goal.
4. Body Part Used for the Shot
The model can also consider how the player shoots.
For example:
- Right-footed shot
- Left-footed shot
- Header
- Volley
- Other types of finishes
Headers generally have different scoring probabilities from shots taken with the foot.
A header from close range following a corner is therefore not automatically treated in exactly the same way as a low shot from the same location.
StatsBomb identifies body part as one of the traditional inputs used by many xG models.See how this metric is used in football in our guide What Are Big Chances in Football?
5. The Type of Pass or Previous Action
Another important part of xG calculation is what happened immediately before the shot.
A shot can come after:
- A through ball
- A cross
- A cutback
- A corner
- A free kick
- A rebound
- A dribble
- A long pass
- Open-play possession
These situations can have different scoring probabilities.
For example, a close-range shot following a precise cutback may be more dangerous than a similar shot taken under heavy defensive pressure.
StatsBomb explains that the type of assist or previous action, including crosses, through balls, set pieces and dribbles, can be incorporated into xG models.
6. Was the Shot From Open Play or a Set Piece?
xG models can distinguish between different types of attacking situations.
A shot might come from:
- Open play
- Penalty
- Corner
- Free kick
- Rebound
- Fast attack
This distinction matters because the circumstances surrounding a shot can influence its likelihood of becoming a goal.
For example, a direct free kick and a close-range rebound are completely different scoring situations, even if both are technically recorded as shots.
7. Defensive Pressure Can Affect xG
More advanced models can go beyond the basic information visible in traditional match statistics.
One such factor is defensive pressure.
A player may have a shot from 10 yards, but the situation can be very different depending on whether:
- A defender is directly in front of him.
- Several defenders are nearby.
- The player has time to control the ball.
- The player is being challenged as he shoots.
Modern football data providers can incorporate contextual information about defenders and pressure into their models.
StatsBomb, for example, records player positions around shots and has developed models that incorporate defensive positioning and other contextual information.
8. Goalkeeper Position Can Influence xG
The goalkeeper's position can also change the quality of a chance.
Imagine two identical one-on-one situations.
In the first:
The goalkeeper stays on the goal line.
In the second:
The goalkeeper comes several metres off the line.
The shooting opportunity may have a different scoring probability depending on the goalkeeper's location.
Advanced xG models can therefore incorporate goalkeeper positioning.
StatsBomb specifically highlights goalkeeper location as additional information used in its xG modelling.
This is one reason why not every xG model is the same.
9. Defender Positions Can Be Included
Some advanced xG models also record the location of defenders when the shot is taken.
This can help distinguish between an open shot and an attempt where several defenders are blocking the route to goal.
For example:
Situation A:
A striker receives the ball six yards from goal with nobody between him and the goalkeeper.
Situation B:
A striker receives the ball six yards from goal with two defenders immediately blocking his route.
The two situations may have different probabilities even though the distance to goal is identical.
StatsBomb's data includes the positions of attackers and defenders in the frame when shots are taken, allowing its models to capture additional contextual information.
10. Historical Data Is the Foundation of xG
This is perhaps the most important part of understanding xG.
An xG model does not simply invent a probability.
It learns from historical shots and their outcomes.
Imagine a database containing hundreds of thousands of shots.
For every shot, the data records characteristics such as:
- Location
- Distance
- Angle
- Body part
- Assist type
- Match situation
- Defensive context
- Goalkeeper position
The model then examines which combinations of characteristics were more or less likely to produce goals.
This allows it to estimate the probability of a new shot becoming a goal.
Hudl StatsBomb describes xG as using historical information from thousands of shots with similar characteristics to estimate the probability of a goal.
A Simple Example of xG Calculation
Suppose an xG model examines a new shot.
The data tells the model:
- Shot distance: close
- Angle: central
- Body part: foot
- Previous action: cutback
- Defensive pressure: low
- Goalkeeper position: favourable for the attacker
After comparing those characteristics with historical shots, the model could assign the attempt:
0.65 xG
That means the model estimates approximately a 65% probability of the shot becoming a goal.
It does not mean the player is guaranteed to score.
The player could score, miss, hit the post or have the shot saved.
The xG value describes the quality of the opportunity, not the actual result.
How Is Team xG Calculated?
Once every shot has an individual xG value, the values can be added together.
For example, imagine a team takes four shots:
| Shot | xG |
|---|---|
| Shot 1 | 0.05 |
| Shot 2 | 0.20 |
| Shot 3 | 0.40 |
| Shot 4 | 0.10 |
| Total | 0.75 |
The team's total xG would therefore be:
0.05 + 0.20 + 0.40 + 0.10 = 0.75 xG
The team created chances that, according to the model, would historically be expected to produce approximately 0.75 goals.
This is why a team can win a match 2–0 while recording only 0.80 xG, or lose 1–0 despite producing 2.00 xG.
The actual score and expected goals measure different things. Learn more about What is xG Per Shot in Football.
Is There a Single xG Formula?
No.
There is no single universal xG formula used throughout football.
Different companies build their own models using different datasets, variables and statistical methods.
One provider may primarily use:
Location + distance + angle + body part + assist type
while another may include additional information such as:
Goalkeeper position + defender position + pressure + shot context + other spatial information.
StatsBomb explicitly notes that different xG models do not necessarily use the same factors, which can result in different xG values for the same shot.
This is important when reading football statistics online.
If one website says a shot was 0.42 xG and another says 0.36 xG, that does not automatically mean one of them is wrong.
They may simply be using different models.
What Statistical Models Are Used to Calculate xG?
Behind the scenes, xG models use statistical and machine-learning techniques to estimate goal probability.
Historically, approaches such as logistic regression have been widely used because the outcome being modelled is binary:
Goal = 1
No goal = 0
More sophisticated models can use machine-learning techniques to identify complex relationships between shot characteristics and goal outcomes.
For example, StatsBomb has described machine-learning approaches in its more advanced modelling work.
The technical details differ between providers, but the basic objective remains the same:
Estimate the probability that a particular shot becomes a goal.
Why Can Two Websites Give Different xG Numbers?
Suppose a player takes a shot and receives:
0.25 xG from one provider.
Another provider might record:
0.31 xG.
There are several possible reasons.
Different data
One provider may have more detailed information about player positions, pressure or goalkeeper location.
Different variables
One model may include defensive positioning while another does not.
Different modelling techniques
Different statistical or machine-learning approaches can produce different probabilities.
Different treatment of events
Providers can also have different definitions for rebounds, penalties, blocked shots and other situations.
Therefore, xG should generally be interpreted within the context of the model producing it.
How Are Penalties Treated in xG?
Penalty kicks are unusual because the shooting location and situation are highly standardised.
Many xG models therefore assign penalties a relatively high xG value.
FBref notes that penalty kicks are typically worth around 0.75–0.80 xG, depending on the model.
This also explains why a team that wins several penalties can accumulate substantial xG even without creating many open-play chances.
xG Is Not the Same as Goals
One of the biggest mistakes when interpreting xG is treating it as a prediction of the final score.
Suppose:
Team A: 2.40 xG
Team B: 0.70 xG
This does not mean Team A should definitely win 2–0.
It means Team A generated chances that, based on the model, had a combined expected goal value of approximately 2.40.
The actual match could finish:
- 0–0
- 1–0
- 2–1
- 3–0
- 4–2
and so on.
Football contains considerable randomness, and individual shots can always produce different outcomes from their historical probabilities.
xG Measures Chance Quality, Not Finishing Quality Alone
Another important point is that xG primarily evaluates the quality of the opportunities.
Suppose two strikers each have:
10 shots
3.00 xG
But one scores four goals and the other scores one.
Their finishing outcomes were very different even though they generated the same expected-goal total.
This is why analysts often compare:
Goals vs xG
to examine whether a player is scoring more or fewer goals than the quality of chances he has received would suggest.
FBref explains that comparing actual goals with xG can provide information about finishing performance and outcomes relative to expected scoring.
What Is the Difference Between xG and Post-Shot xG?
Standard xG is generally calculated when the shot is taken, using information about the opportunity.
Post-shot xG, often written as PSxG, evaluates the shot after it has been struck and can incorporate information about where the ball was directed.
This makes PSxG particularly useful for evaluating goalkeepers.
For example, two shots could both have an initial xG of 0.30, but one might be struck directly at the goalkeeper while the other is placed into the corner.
Post-shot models can distinguish between those outcomes more effectively.
StatsBomb explains that post-shot xG considers shot placement and can be used to assess goalkeeper shot-stopping.
Does xG Consider the Player's Ability?
Usually, standard xG does not simply give a chance a higher value because a famous or highly skilled striker is taking the shot.
The model is generally trying to answer:
“How likely is this type of chance to result in a goal?”
rather than:
“How likely is this specific player to score it?”
That distinction is important.
A chance worth 0.40 xG can remain approximately 0.40 regardless of whether the player taking it is an elite finisher or a less prolific scorer, depending on the model.
Some advanced approaches can separately examine player-specific finishing or execution, but that is different from the basic xG concept. FBref specifically notes that its xG does not account for the individual quality of the player involved and instead represents how an average player would perform in a similar situation.
How Accurate Is xG?
xG is useful, but it is not a guarantee of what will happen on an individual shot.
A 0.90 xG chance can still be missed.
A 0.02 xG shot can still become a goal.
This is because probability describes what happens across many comparable situations rather than determining the result of one individual event.
The value of xG becomes more informative when analysing larger samples of shots and matches.
That is why analysts often use xG across multiple matches rather than judging an entire attacking performance from one chance.
Why Is xG Useful in Football?
xG can help answer questions that the final score alone cannot.
For example:
Did a team create good chances despite losing?
Did a team dominate possession without creating dangerous opportunities?
Did a striker score from difficult chances?
Did a goalkeeper face high-quality attempts?
Was a 1–0 victory based on sustained chance creation or a single low-probability goal?
These are some of the reasons xG has become an important part of football analysis.We explain this statistic in detail in our guide How to Read Football Match Statistics.
xG Calculation: The Simple Version
If you want to understand the process without the technical mathematics, remember this:
Step 1: Collect historical shots
A model starts with a large database of previous shots.
Step 2: Record the characteristics
The data can include:
- Location
- Distance
- Angle
- Body part
- Assist type
- Set-piece/open play
- Defensive pressure
- Goalkeeper position
- Defender position
Step 3: Train the statistical model
The model learns how these characteristics relate to whether shots become goals.
Step 4: Evaluate a new shot
When a new shot occurs, its characteristics are fed into the model.
Step 5: Produce a probability
The model produces a number between 0 and 1.
That number is the shot's xG.
Step 6: Add individual shots
The xG values of all shots taken by a team can be added together to produce the team's total xG.
Example: Calculating a Team's xG
Imagine a match where Team A has five shots:
| Shot | xG |
|---|---|
| Long-range effort | 0.03 |
| Header | 0.08 |
| One-on-one | 0.48 |
| Close-range shot | 0.36 |
| Penalty | 0.76 |
| Team xG | 1.71 |
The calculation is:
0.03 + 0.08 + 0.48 + 0.36 + 0.76 = 1.71 xG
Team A therefore finishes the match with 1.71 xG.
This doesn't mean Team A should necessarily score exactly 1.71 goals. It means the combined quality of its chances corresponds to an expected goal value of 1.71.
What Factors Affect xG the Most?
The exact importance of each variable depends on the model, but common factors include:
- Shot location
- Distance from goal
- Shooting angle
- Body part
- Type of assist
- Previous attacking action
- Open play or set piece
- Defensive positioning
- Goalkeeper positioning
- Pressure and other contextual information
More advanced models can use even richer information.
For example, StatsBomb has described using goalkeeper location, defender positions and shot-impact height in its modelling.
Common Misunderstandings About xG
“0.50 xG means the player had to score.”
False.
It means the model estimates approximately a 50% scoring probability for that type of chance.
“A team with more xG always wins.”
False.
xG measures chance quality, while the final score measures actual goals.
“All websites calculate xG the same way.”
False.
Different providers use different models and data.
“xG is the predicted final score.”
Not exactly.
It is primarily an aggregate measure of the scoring probability of individual chances.
“A shot from close range always has high xG.”
Not necessarily.
Other factors can influence the probability, including angle, defensive pressure, goalkeeper position and the type of shot.
xG vs xA: What Is the Difference?
xG measures the probability that a shot will become a goal.
xA, or expected assists, estimates the likelihood that a pass or chance-creating action will result in an assist based on the subsequent shot.
For example, if a player delivers a pass that creates a very good shooting opportunity, the pass can receive a high xA value even if the teammate eventually misses.
This makes xG and xA useful complementary statistics.
Final Takeaway: How Is xG Calculated in Football?
So, how is xG calculated in football?
The simplest answer is:
xG is calculated by using historical shot data to estimate the probability that a particular shot will result in a goal.
The model examines characteristics surrounding the attempt, which can include shot location, distance, angle, body part, assist type, defensive pressure, goalkeeper position and other contextual information.
Every shot receives an individual probability between 0 and 1. Those individual probabilities can then be added together to calculate a team's or player's total xG.
The important thing to remember is that xG is a probability, not a guarantee. A 0.80 xG chance can be missed, while a 0.03 xG attempt can be scored.
Different providers can also produce different xG values because they use different datasets and modelling methods.
That is what makes xG so useful: rather than looking only at what happened, it helps football analysts examine the quality of the chances that produced the result.
Frequently Asked Questions
How is xG calculated in football?
xG is calculated using a statistical model trained on historical shots. The model evaluates factors such as shot location, distance, angle, body part, assist type and, in more advanced models, goalkeeper and defender positioning.
What does 0.50 xG mean?
A 0.50 xG shot has an estimated 50% probability of becoming a goal according to the particular xG model being used.
Is there one universal xG formula?
No. Different football data providers use different models, datasets and variables, so the same shot can receive different xG values.
Does xG include penalties?
Yes. Penalties are normally assigned a high xG value because they are taken from a standardised position with relatively favourable conditions. The exact value depends on the model.
Does xG measure finishing ability?
Standard xG primarily measures the quality of the chance rather than simply rating the shooter's finishing ability. Comparing goals with xG can, however, help analysts study finishing outcomes.
Why do different websites show different xG?
Different providers use different datasets, variables and statistical models. More advanced models can also incorporate information such as goalkeeper position, defender position and pressure.
What is the difference between xG and PSxG?
xG evaluates the quality of the opportunity around the time of the shot, while post-shot xG can incorporate where the shot was actually directed after it was struck. PSxG is particularly useful for analysing goalkeepers.
Article Source Credit:

No comments:
Post a Comment