Thomas A. Anderson, a computer programmer, leads a secret life in hacking computers and illegally obtaining then selling of software under the alias "Neo". Through his work on the internet, he came to the search for the answer of "What is the Matrix?". Soon, cryptic messages appear on his monitor, eventually leading to an encounter with Trinity. Later, he is hunted through his office building by agents, to which he is interrogated and has an insect-like robot planted in his stomach.
After this, he is reunited with Trinity, as well as two of her companions, Apoc, and Switch. They remove the bug, then take Neo to Morpheus, an internationally infamous and elusive figure. At this meeting, he offers Neo the chance to discover what the Matrix is, via a red pill, or to forget everything, by way of the blue pill. Neo accepts, swallowing the red pill.
Soon, he awakens in a liquid-filled pod, wires connected to his body and plugging him into a vast tower covered with identical pods. A massive robot comes, causing the connection to be severed, and flushing him down a tunnel, after which he is rescued by Morpheus and taken aboard his hovercraft, the Nebuchadnezzar. As he had been stationary all of his life, his muscles had become atrophied, and thus were required to be rebuilt.
The exact year is unknown, but is believed to be nearer to 2199 than 1999, and humanity is fighting a war against intelligent machines created in the early 21st century. The sky is covered in thick black clouds created by the humans in an attempt to cut off the machines' supply of solar power. The machines responded by using human beings as their energy source, growing countless people in pods and harvesting their bioelectrical energy and body heat. The world which Neo has inhabited since birth is the Matrix, an illusory simulated reality construct of the world of 1999, developed by the machines to keep the human population docile. Morpheus and his crew are a group of free humans who "unplug" others from the Matrix and recruit them to their resistance against the machines. Within the Matrix they are able to use their understanding of its nature to bend the laws of physics within the simulation, giving them superhuman abilities. Morpheus believes that Neo is "the One", a man prophesied to end the war through his limitless control over the Matrix.
Neo is trained to become a member of the group. A socket in the back of Neo's skull, formerly used to connect him to the Matrix, allows knowledge to be uploaded directly into his mind. He learns numerous martial arts disciplines, and demonstrates his kung fu skills by sparring with Morpheus in a virtual reality "construct" environment similar to the Matrix, impressing the crew with his speed. Further training introduces Neo to the key dangers in the Matrix itself. Injuries suffered there are reflected in the real world; if he is killed in the Matrix, his physical body will also die. He is warned of the presence of Agents, powerful and fast sentient programs with the ability to take over the virtual body of anyone still connected to the system, whose purpose is to seek out and eliminate any threats to the simulation. Yet Morpheus predicts that once Neo fully understands his own abilities as "the One" they will be no match for him.
The group enters the Matrix and takes Neo to the apartment of the Oracle, the woman who has predicted the eventual emergence of the One. She tells Neo that he has "the gift", but that he is waiting for something, perhaps the next life. Neo interprets from this that he is not "the One". She adds that Morpheus believes in Neo so blindly that he will sacrifice his life to save him. Returning to the hacked telephone line which serves as a safe "exit" from the Matrix, the group is ambushed by Agents and SWAT, Morpheus is captured as Neo and the others escape. The group was betrayed by a member of their crew, Cypher. Cypher preferred living his old life in ignorance of the real world's hardships, and made a deal with the Agents to give them Morpheus in exchange for a permanent return to the Matrix. The betrayal leads to the deaths of all crew-members except Neo, Trinity, Tank, and Morpheus, who is imprisoned in a government building within the Matrix. The Agents attempt to gain information from him regarding access codes to the mainframe of Zion, the humans’ last refuge which is deep underground. Neo and Trinity return to the Matrix and storm the building, rescuing their leader. Neo becomes more confident and familiar with manipulating the Matrix, ultimately dodging bullets fired at him by an Agent. Morpheus and Trinity use a subway station telephone to exit the Matrix, but before Neo can leave, he is ambushed by Agent Smith. He stands his ground and eventually defeats Smith, but flees when the Agent possesses another body.
As Neo runs through the city towards another telephone exit, he is pursued by the Agents while "Sentinel" machines converge on the Nebuchadnezzar's position in the real world. Neo reaches an exit, but he is shot dead by the pursuing Agent Smith. Back onboard the Nebuchadnezzar, in the real world, Trinity whispers to Neo that she was told by the Oracle that she would fall in love with "the One", implying that Neo is "the One". She refuses to accept his death and kisses him. Neo's heart beats again, and within the Matrix he stands up; the Agents shoot at him, but he raises his palm and stops their bullets in mid-air. Neo sees the Matrix as it really is: lines of streaming green code; he finally becomes "the One". Agent Smith makes a final attempt to attack him, but his punches are effortlessly blocked, and Neo destroys him. The other two Agents flee, and Neo returns to the real world just in time for the ship's EMP weapon to destroy the Sentinels that had already breached the hull of the ship. A short epilogue shows Neo back in the Matrix, making a telephone call promising that he will demonstrate to the people imprisoned in the Matrix that "anything is possible." He hangs up the phone and flies into the sky.