A theory states that if anyone discovers what the universe is and its purpose, it would immediately disappear and be replaced by something more bizarre and unexplainable. Another theory argues this has already happened.
In the first book, an immensely powerful supercomputer, called Deep Thought, attempted to answer the Ultimate Question of Life, the Universe and Everything. After 7.5 million years, Deep Thought concluded that the answer was 42; another more complicated computer, Earth, was created to determine the question itself. Humans were part of the computer matrix meant to devise the question.
Just before the question was formulated, Earth was destroyed by the Vogons (stupid, violent, heartless extraterrestrials) to make way for a new hyperspace bypass. Tricia McMillan, called Trillian, and Arthur Dent are the only human survivors. Arthur escaped Earth’s destruction with the help of Ford Prefect, an interplanetary hitchhiker. Trillian left Earth six months earlier to travel with Zaphod Beeblebrox, the president of the galaxy.
Currently, a Vogon starship is pursuing the Heart of Gold, the ship occupied by Arthur, Trillian, Zaphod, Ford and Marvin the depressed robot. Most of the group realizes they are under attack, but an unaware Arthur asks the Nutri-Matic Drinks Synthesizer for a cup of tea, which freezes up the computer and prevents the group from escaping. Zaphod impulsively holds a séance for his great-grandfather, Zaphod Beeblebrox the Fourth, whose ghost appears.
Zaphod and his great-grandfather discuss why Zaphod the First locked parts of his brain to hide information from himself. Zaphod had things that he wanted to forget, but he left orders in his brain to fulfill a purpose. His great-grandfather reminds Zaphod that his position as president of the galaxy is meaningless, telling him to find the true ruler of the Universe. A bolt of light flashes from the ghost’s hands, and the Heart of Gold warps through time and space.
Psychiatrist and sponsor for the Vogons, Gag Halfrunt, believes that all humans are dead. He ordered the destruction of Earth in order to halt the search for the Ultimate Question of Life, the Universe, and Everything. If the question were discovered, psychiatrists would become irrelevant. Aboard the Heart of Gold, Marvin and Zaphod have disappeared, and the ship is inoperable, but the computer has solved Arthur’s query for tea.
Zaphod finds himself on Ursa Minor Beta, the wealthy and sunny planet where The Hitchhiker’s Guide to the Galaxy was published. The Guide is a popular companion for hitchhikers who want to travel cheaply through the known Universe. It contains information about various creatures and locations throughout the galaxy.
The locked-off part of Zaphod’s brain tells him to find Zarniwoop, who works in the Guide’s offices. As Marvin and Zaphod search for Zarniwoop, fighters from the planet Frogstar B attack them. Zaphod meets a man named Roosta, and they go to his office. However, Zarniwoop is on an intergalactic cruise through the use of his digital universe. Zarniwoop uses an artificial universe, which is identical to the real one, to explore the universe.
The Frogstar Fighters rip the tower containing the Guide’s offices from the planet and take it with them. They head toward Frogstar B, their planet. Roosta believes Zaphod is supposed to be fed into the Total Perspective Vortex to keep him from finding the true Ruler of the Universe. The Vortex shows a person how small he or she is in relation to the universe, destroying his or her soul.
When Zaphod leaves the building, Roosta tells him to leave by the window, not the door. Zaphod voluntarily enters the Vortex, as he doesn’t see any other option. When Zaphod is in the Vortex, he is shown that he is the most important person in the universe and survives.
Zaphod stumbles upon Zarniwoop, who tells Zaphod that he has been in an artificial universe since he entered Zarniwoop’s office in the Guide’s offices. If Zaphod had left by the door, he would have exited the artificial universe. Zaphod survived the Vortex because he was the most important person in the artificial universe; he could not have survived the real Vortex.
Zarniwoop reveals that they knew each other before Zaphod sealed off a part of his brain. They had arranged for him to steal the Heart of Gold, the only ship that could reach the world of the Ruler of the Universe. Zarniwoop returns Zaphod to the real universe.
A model of the Heart of Gold in Zaphod’s pocket turns out to be the real thing, and it returns to its normal size. The party is reunited. Zaphod tells the computer they want to go to the nearest place to eat. The group, minus Zarniwoop, disappears from the ship and ends up at Milliways, the Restaurant at the End of the Universe. Milliways is built on a ruined planet and depicts the instant the Universe ends. Guests enjoy a meal as they watch the Universe explode. After the show, the guests leave, and the restaurant resets itself for the next meal.
Ford gets drunk and makes a fool of himself talking to Hotblack Desiato, a rock star who is spending a year dead for tax reasons. A cow-like creature, the Dish of the Day, visits the table and asks what part of it the group would like to eat. Arthur is disturbed and settles for a salad, but the rest of the group is unfazed. Zaphod gets a phone call from Marvin, who was accidentally left on Frogstar B. He has been waiting for the group for 566 thousand million years.
The group goes to Milliways’ parking garage to meet Marvin. Next to Hotblack Desiato’s limo, Zaphod finds a black spaceship and intends to steal it. The group enters the ship. Along with his bodyguard, Hotblack Desiato returns to his limo. The bodyguard activates autopilot for the black ship. Since they have no control over the ship, it goes back in time, millions of years, farther than Arthur and company intended.
The ship’s purpose is to be hurled into the sun as a part of a concert by Hotblack Desiato’s band, Disaster Area. The party uses the ship’s matter transference teleport to escape. However, the system is damaged, so they have no idea where they will turn up, and Marvin has to operate the system manually. He is presumably destroyed as the ship crashes into the sun.
Arthur and Ford find themselves on a spaceship filled with 15 million cryogenically frozen people. The captain of the ship tells them that they are from the planet Golgafrincham. After being deemed useless, the entire middle class population was tricked into boarding a ship and sent to colonize another planet. The ship crashes onto a planet. Ford tries to hitchhike off the primitive planet, but fails.
Meanwhile, Zaphod and Trillian rematerialize in the Heart of Gold. Zarniwoop has put it on course to visit the Ruler of the Universe. Zaphod, Trillian and Zarniwoop arrive, only to discover that the Ruler of the Universe does not want to be the Ruler of the Universe, which makes him an ideal candidate for the job. He is unsure if anything exists other than himself. He believes universes are contained within the eyes or ears of people, so they have no external proof that anything else exists. As Zarniwoop grows frustrated with the Ruler of the Universe, Zaphod and Trillian leave in the Heart of Gold, stranding Zarniwoop on the planet.
Ford and Arthur meet a primitive people on the planet where they are stranded. They reach the coastline and see the face of Slartibartfast, who helped create Earth, etched into a glacier. They realize that the planet they are on is Earth.
Ford becomes frustrated with the Golgafrinchans when he sees how little progress they have made in their six months on Earth. Instead of creating useful things such as fire, the Golgafrinchans have spent their time on committee meetings and documentaries about themselves. Ford and Arthur realize that the Golgafrinchans are the ancestors of humans.
While trying to teach the primitive people to play Scrabble, they spell out 42 with letters. Ford and Arthur surmise that the natives, who were eventually killed off, were a part of the computer matrix intended to determine the Question to the Ultimate Answer; therefore, the Golgafrinchans or the humans were not meant to be part of this system.
However, they think Arthur’s subconscious may have picked up the question. Arthur begins fishing letters out of a bag with his eyes closed and spells out a question: What do you get if you multiply six by nine? It is implied that there is no correct question or that it has been lost. Arthur tosses his copy of The Hitchhiker’s Guide to the Galaxy into a river.