On January 5, 1900, four friends arrive for a dinner at the house of H. George Wells (Rod Taylor), who staggers in to describe his strange experiences. Earlier, Wells had described time as "the fourth dimension" to David Filby (Alan Young) and Dr. Philip Hillyer (Sebastian Cabot). He showed them a small machine that he claimed can travel in time. The friends are dismissive, saying that it is preposterous, despite the model transporting a cigar through time.
Wells uses a larger time machine to travel 17 years into the future, where he meets Filby's son James and learns of Filby's death in the Great War. Wells then travels to June 19, 1940, into the midst of "a new war", stopping briefly when his machine is buffeted from side to side. He stops in August 19, 1966, in a futuristic metropolis. He is puzzled to see people hurrying into a fallout shelter amid the blare of air raid sirens. An elderly James Filby tells him to get into the shelter. James is surprised that Wells has not aged.
A nuclear explosion causes a volcano to erupt. Civilization is destroyed in a nuclear holocaust. Wells restarts the machine just in time to avoid being incinerated, but lava covers the machine, then cools and hardens, forcing him to travel far into the future until it erodes away. He stops the machine in the year 802,701, next to a low building with a large sphinx on top. He spots a woman drowning while others are indifferent. Wells rescues her, but is surprised by her lack of gratitude. She calls herself Weena (Yvette Mimieux) and her people the Eloi.
Wells questions the Eloi about their civilization and finds they have no books. He discovers that the time machine has been locked inside the sphinx building. Weena follows Wells and insists they go back, for fear of "Morlocks" at night. A Morlock jumps out of the bushes and tries to drag Weena off, but Wells rescues her. The next day, Weena shows Wells what appear to be domed well-like air-shafts in the ground. She then takes him to an ancient museum, where "talking rings" tell of a centuries-long nuclear war.
One group of survivors remained underground in the shelters and evolved into the Morlocks, while the other group returned to the surface and became the Eloi. Wells climbs down a shaft, but turns back when a siren blares from atop the sphinx building. Weena and the rest of the Eloi enter a trance-like state, and complacently file through the now-open doors of the building. When the siren stops, the doors close, trapping Weena and others inside. To rescue Weena, Wells climbs down a shaft and enters the subterranean caverns.
He is horrified to discover that the Eloi are little more than free range livestock to the Morlocks. He fights the Morlocks, aided by the Eloi, who prove not to be completely helpless. Before escaping with the Eloi up the shaft, he starts a fire that spreads through the cavern. Under his direction, the Eloi drop dry tree branches into the shafts to feed the fire.
The entire area caves in, crushing and suffocating most of the Morlocks below. The next morning, Wells finds the sphinx building in charred ruins and the doors open again, with his time machine sitting just inside the entrance. He enters to retrieve the machine, but the doors close behind him and he is attacked by the remaining Morlocks.
He uses the time machine to escape, returning to January 5, 1900, in time to meet his old friends for dinner and tell them about his adventure. Wells's friends scoff at his story, but he finds Weena's flower in his coat pocket, convincing Filby. Wells leaves again in the time machine back to the future. Filby notices tracks where Wells dragged the machine back to its original location before leaving so that he would be outside the sphinx building when he returns to the future. Filby and Wells's housekeeper notice three books are missing from Wells's library.