Thomas Anderson is a computer programmer who maintains a double life as the hacker "Neo". He is driven to learn the meaning of cryptic references to "the Matrix" that appear on his computer. Infamous hacker Trinity contacts Neo and informs him that a man named Morpheus can tell him what the Matrix is; however, three Agents, led by Agent Smith, arrest Neo to prevent this. Undeterred, Neo meets with Morpheus and confirms that he wants to learn more about the Matrix by choosing an offered red pill. After swallowing the pill, Neo abruptly awakens in a liquid-filled vessel. His body is pierced with cables that connect him, along with billions of other people, to an elaborate electrical network. He is rescued by Morpheus and brought aboard a levitating ship, the Nebuchadnezzar.
Morpheus tells Neo that humans are fighting against intelligent machines that were created in the 21st century and have since taken control of the Earth's surface. Humans polluted the sky to cut off the machines' solar power, but the machines adapted to using human bioelectricity as a power source. Enslaved humans are kept docile within the "Matrix" – a simulation of the world as it was in 1999. Neo has lived in this simulated world since birth; in reality, the year is closer to 2199. Morpheus explains that he and his crew belong to a group of free humans who "unplug" others from the Matrix and recruit them to their rebellion against the Machines. They can hack into the Matrix and re-enter the simulated reality, where their understanding of its true nature allows them to manipulate its physical laws, granting them superhuman abilities. Neo undergoes virtual combat training. He is warned that fatal injuries within the Matrix will also kill one's physical body, and that the Agents he encountered are powerful sentient programs that patrol the Matrix and eliminate threats to the system. Morpheus believes Neo is "the One", a man prophesied to end the war between humans and machines.
After Neo's training, the group enters the Matrix to visit the Oracle, a prophet who predicted the emergence of the One. The Oracle implies that Neo is not the One, and warns he must soon choose between his own life and that of Morpheus.
As the group prepares to exit the Matrix, they are ambushed by Agents and tactical police, leading to the death of a crew member called Mouse. Morpheus allows himself to be captured to let Neo and the rest of the crew escape. As they prepare to leave the Matrix, they learn that a crew member named Cypher has betrayed them. Disillusioned with the real world, Cypher had arranged to hand Morpheus over to the Agents in exchange for being returned to a comfortable life within the Matrix. Aboard the Nebuchadnezzar, Cypher murders crew members Switch, Apoc and Dozer before he is killed by Dozer's brother Tank.
In the Matrix, the Agents interrogate Morpheus to learn his access codes to the mainframe computer in Zion, the humans' last refuge in the real world. Neo returns to the Matrix with Trinity and rescues Morpheus; in the process, Neo gains confidence in his ability to manipulate the Matrix, performing physical feats on a par with the Agents.
Morpheus and Trinity exit the Matrix, but Neo is ambushed by Smith before he can leave. In the real world, "sentinel" machines converge on the Nebuchadnezzar. In the Matrix, Smith kills Neo. In the real world, Trinity whispers to Neo that the Oracle told her she would fall in love with the One. She kisses Neo, and he revives in the Matrix. He displays the power to perceive and control the Matrix, effortlessly destroying Smith before exiting the Matrix in time for the ship's EMP weapon to destroy the attacking sentinels. In the Matrix, Neo makes a telephone call, promising the Machines he will show their prisoners "a world where anything is possible". He ends the call and flies into the sky.