Most of the game is set in a remote desert area of New Mexico in the Black Mesa Research Facility, a fictional complex that bears many similarities to both the Los Alamos National Laboratory and Area 51, at some point between the 2000s. The game's protagonist is the theoretical physicist Gordon Freeman, an 27-year old MIT graduate who holds a Ph.D.. Freeman becomes one of the survivors of an experiment at Black Mesa that goes horribly wrong, when an unexpected "resonance cascade"—a fictitious phenomenon —rips dimensional seams, devastating the facility.

Aliens from another dimension known as Xen subsequently enter the facility through these dimensional seams (an event known as the "Black Mesa incident"). As Freeman tries to make his way out of the ruined facility, he soon discovers that he is caught between two sides: the hostile aliens and the Hazardous Environment Combat Unit, a U.S. Marine Corps special operations unit dispatched to cover up the incident by eliminating the organisms, as well as Dr. Freeman and the other surviving Black Mesa personnel to keep them from talking. Throughout the game, a mysterious figure known (but not actually referred to in-game) as the "G-Man" regularly appears, and seems to be monitoring Freeman's progress. Ultimately, Freeman uses the cooperation of surviving scientists and security officers to work his way towards the mysterious "Lambda Complex" of Black Mesa (signified with the Greek "λ" character), where a team of survivors teleport him to the alien world Xen to kill the Nihilanth, the semi-physical entity keeping Xen's side of the dimensional rift open.