The basic idea
A player is in an offside position if, at the moment the ball is played to them, they are nearer to the opponent's goal line than both the ball and the second-last opponent — which in practice is usually the last outfield defender, since the goalkeeper is almost always the last one. Being in an offside position is not an offence by itself. It only becomes offside if the player then gets involved in active play — receiving the ball, interfering with an opponent, or gaining an advantage from that position.
Why "level" is not offside
A common misunderstanding is that a player level with the last defender is offside. They are not. The rule requires the attacker to be nearer to the goal line than the defender, so being exactly level counts in the attacker's favour. This is precisely why offside decisions are drawn using thin lines on replays — the margin that separates onside from offside is sometimes a matter of centimetres.
When it does not apply
Offside is not called from a throw-in, a corner kick or a goal kick, even if a player is standing in what would normally be an offside position. It also only applies in the opponent's half of the pitch — a player cannot be offside inside their own half, no matter where the defenders are standing.
Why VAR changed how it feels
Video assistant referee reviews now draw a line through the attacker's furthest-forward body part and a second line through the defender at the moment the ball is played. Because these lines are drawn to the exact pixel, decisions that once looked comfortably onside or offside to the naked eye are now sometimes shown to be offside by a matter of millimetres. The rule itself has not changed — the precision used to enforce it has.
Why the rule exists
Without an offside rule, attackers could simply camp next to the opponent's goal and wait for a long ball forward, turning matches into a stretched-out game with no real midfield contest. The rule forces attacking play to build through the pitch rather than around it, which is why it has survived, largely unchanged in principle, since football's earliest codified rules.
If you follow Indian football specifically, our explainer on how the ISL format actually works is a good next read. More like this in our Sports section.