Australia's hopes of direct qualification for the 2018 Russia World Cup are on the line when the Socceroos play Thailand in Melbourne tonight.

The top two teams from the group will get direct entry to Russia, with the third-placed team to advance to another round.

With the Socceroos third on the table but tied on points with second-placed Saudi Arabia, there are many different scenarios that need to be considered.

When are Australia's and Saudi Arabia's games?

The Socceroos face bottom-placed Thailand at Melbourne's Rectangular Stadium at 8:00pm (AEST).

Saudi Arabia hosts the Samurai Blue at the King Abdullah Sports City Stadium at 3:00am (AEST) on Wednesday.

What are the possible outcomes?

If Australia wins and Saudi Arabia loses: The Socceroos are going to Russia! They jump to second on the table and directly qualify for the World Cup.

The Socceroos are going to Russia! They jump to second on the table and directly qualify for the World Cup. If Saudi Arabia wins and Australia loses: Saudi Arabia secures its direct path to Russia and Australia will most likely finish third and be on to the way to the fourth round of the Asian section of World Cup qualifying.

Saudi Arabia secures its direct path to Russia and Australia will most likely finish third and be on to the way to the fourth round of the Asian section of World Cup qualifying. If both teams draw: Nothing changes and Saudi Arabia is the team to advance.

Nothing changes and Saudi Arabia is the team to advance. Other scenarios involving a draw: If one team draws and the other team wins then the winning team will get direct qualification.

If one team draws and the other team wins then the winning team will get direct qualification. If both teams lose: It's likely that the table will stay unchanged, and again Saudi Arabia would be on the way to Russia. But if Japan thrashed Saudi Arabia and Australia didn't lose too badly, the Socceroos would finish second.

But what if both teams win?

The Socceroos need to rediscover their goal-scoring form against Thailand. ( AP: Pavel Golovkin )

This is where it gets tricky. Both teams would remain equal on points so the next tiebreaker is goal difference.

Saudi Arabia comes into these final matches with a two-goal advantage over Australia on goal difference. So for Australia to get to second it would need to close that gap.

For example, if the Socceroos won 4-0 and Saudi Arabia won 1-0, Australia would move into second. There are of course many results that could give Australia the advantage on goal difference.

What if the outcome of both matches leaves Australia and Saudi Arabia tied on both points and goal difference?

It sounds ridiculous but it is quite possible. For example, if the Socceroos won 4-1 and Saudi Arabia won 1-0 then the two teams would be tied on both points and goal difference.

It then comes down to the most goals scored across this stage of qualifying. Before these final matches Saudi Arabia had scored two more goals than Australia.

Adding on the goals from the above hypothetical, Australia would advance. But slight changes in the score lines can change that.

What if the outcome of both matches leaves Australia and Saudi Arabia tied on all of points, goal difference and goals scored?

Sorry, this video has expired The Socceroos' 2-0 loss to Japan hurt their Russia 2018 prospects. (Photo: AP)

This sounds even more ridiculous but it is still quite possible! If Australia won 3-0 and Saudi Arabia won 1-0 then we're in that exact situation.

Then it comes down to who has the better head-to-head record from the two matches already played between Australia and Saudi Arabia.

Saudi Arabia drew with Australia 2-2 in Jeddah last October and Australia beat Saudi Arabia 3-2 in Adelaide in June. So the Socceroos get the nod if it came to this.

What happens if Australia finishes third?

The Socceroos would move into the fourth round of the Asian section of qualifying. This is a play-off in early October between the two third placed teams from groups A and B (Australia's group).

There are two matches, one home and one away, to determine who advances to the inter-confederation play-offs.

Syria is currently third in group A and assuming the results of that group's final matches go as expected, that won't change.

And if the Socceroos won the fourth round play-off?

There will be serious questions posed to coach Ange Postecoglou (left) if the Socceroos miss out. ( AAP: Julian Smith )

Australia would then move onto the inter-confederation play-offs. This would be a two-match event starting in early November against the fourth-placed team from CONCACAF (Confederation of North, Central American and Caribbean Association Football).

That team is currently Honduras but there are quite a few matches still to come in that group. The United States and Panama are also around the mark.

The winning country of this play-off is then through to Russia.

Can Australia drop to fourth?

It's unlikely. But if Australia lost and United Arab Emirates thumped Iraq it is possible.