Arthur Dent wakes up hungover one day and notices construction machinery stationed outside his house. Slowly, he recalls what he learned the previous evening: his house is set to be demolished to make way for a new bypass. Rushing outside, he confronts Mr. Prosser, the construction foreman, by lying in front of his bulldozer. Prosser tries to convince him to stop, pointing out that Arthur could have objected to the plans when they were first posted. However, Arthur maintains that he never even knew about the plans until yesterday evening, when he went to the local planning office to see where the notice was supposedly “displayed”: “in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying ‘Beware of the Leopard.’”
As Arthur and Prosser argue, Arthur’s friend Ford Prefect rushes onto his property and tries to convince him to come to the pub. Unbeknownst to Arthur, Ford is actually an alien who has been waylaid on earth for the past fifteen years. He first came to the planet to gather more information for an updated edition of The Hitchhiker’s Guide to the Galaxy, which traveling aliens use as a reference book. For now, though, Arthur thinks Ford is human, and he’s surprised to hear that his friend wants to go to the pub so early in the day. Ford promises Arthur that he’ll convince Prosser to refrain from knocking down his house. Indeed, he succeeds in doing this by using an absurd argument that ends with Prosser himself lying in front of the bulldozer as a substitute for Arthur.
At the pub, Ford tells Arthur to drink five pints of beer as fast as he can because the world is about to end. Nobody in the pub believes him, but Arthur guzzles down the booze anyway. Arthur doesn’t know this, but Ford received a transmission last night on his Sub-Etha Sens-O-Matic, which told him that the Vogon alien race was approaching earth in huge spaceships. The Sub-Etha Sens-O-Matic is one of many valuable items Ford Prefect always carries with him, including a towel (the most useful item for hitchhiking) and The Hitchhiker’s Guide to the Galaxy, which is a small electronic contraption that holds millions of pages that can be called up onscreen.
Soon enough, the Vogon spaceships arrive and make an announcement as they hover over earth: “This is Prostetnic Vogon Jeltz of the Galactic Hyperspace Planning Council,” a voice says over a PA system. “As you will no doubt be aware, the plans for development of the outlying regions of the Galaxy require the building of a hyperspatial express route through your star system, and regrettably your planet is one of those schedule for demolition.” At this, everybody on earth begins to panic, so the voice returns and says: “There’s no point in acting all surprised about it. All the planning charts and demolition orders have been on display in your local planning department in Alpha Centauri for fifty of your Earth years, so you’ve had plenty of time to lodge any formal complaint and it’s far too late to start making a fuss about it now.” Not long thereafter, the spaceships “energize” their “demolition beams” and destroy the planet.
Meanwhile, Zaphod Beeblebrox, the two-headed President of the Galaxy, prepares for a public appearance on a far-off planet. The purpose of this appearance is for Zaphod to reveal to the Galaxy a new spaceship called the Heart of Gold. Zaphod is excited to make this announcement, for he has a secret plan that will shock the Galaxy. Upon seeing the Heart of Gold, he says: “That is so amazingly amazing I think I’d like to steal it.” With this, he sets off a bomb as a distraction and jumps into the Heart of Gold with his girlfriend, Trillian, who is a human traveling through space with her two pet mice.
Meanwhile, Arthur finds himself on the Vogon spaceship with Ford, who helped him stow away on the aircraft. Ford explains what has happened and tells Arthur to heed the advice written on the front of The Hitchhiker’s Guide to the Galaxy: “Don’t panic!” Nonetheless, Arthur begins to fret when Ford tells him that Vogons hate hitchhikers. To make things worse, Prostetnic Vogon Jeltz comes onto the intercom and says that the ship is being searched for stowaways. When Ford and Arthur are discovered, they’re taken to Prostetnic Vogon Jeltz, who recites his poetry to them as a method of torture before throwing them into outer space.
According to The Hitchhiker’s Guide to the Galaxy, a person can hold their breath for approximately 30 seconds while hurdling through space, at which point he or she will die unless a passing spaceship happens to intercept him or her. The chances of this happening are 2^276,709 to 1 in favor of the person dying. Against these odds, though, Ford and Arthur are saved by the Heart of Gold, suddenly finding themselves inside the ship as their figures contort. For instance, Ford turns into a penguin and Arthur’s limbs start drifting off. Ford realizes that he and his friend have been saved by a ship that uses an “Infinite Improbability Drive,” something that enables a craft to cross “vast interstellar distances in a mere nothingth of a second” by manipulating the laws of improbability. This is why Ford and Arthur have been saved: the utter unlikeliness of their survival perfectly linked up with the Heart of Gold’s Improbability Drive.
Before long, Ford and Arthur return to their normal forms, and Zaphod and Trillian send Marvin—a depressed robot—to fetch them. When they enter the main part of the spaceship, they discover that they all know each other. Zaphod and Ford are distant cousins, and Arthur knows Trillian from a party on earth, where he flirted with her until Zaphod—on vacation on earth—swept in and took her away with him.
Once everybody reacquaints themselves with one another, Zaphod explains that they are going to Magrathea, an ancient planet built by a race of beings who design custom-built planets. Ford, for his part, maintains that Magrathea is the stuff of legends, insisting that nobody actually believes it ever existed. Nonetheless, Zaphod tells them that this is where they’re headed, and before long, their spaceship picks up a broadcast from an approaching planet. The broadcast is an old recording that confirms that they are, in fact, entering the vicinity of Magrathea. The voice thanks them for their interest but says that “the entire planet is temporarily closed for business.” When the Heart of Gold continues to approach, another message plays, asking them to leave. Finally, a third message informs them that there are now guided missiles pursuing their ship. Trying to steer away from the mayhem, the crew accidentally turns the ship upside-down, but Arthur has the good idea to hit the Infinite Improbability Drive, which turns the two missiles into a bowl of petunias and a sperm whale, respectively. Suddenly, the group finds themselves sitting at peace in an entirely different interior console, since the ship has changed as a result of their use of the Improbability Drive. Nonetheless, they’re able to land, and Zaphod leads them out onto the planet’s desolate surface.
While Zaphod, Trillian, and Ford descend into a hole in the planet made by the impact of the sperm whale—which fell from great heights—Arthur stands watch with Marvin, who, in his depressive state, decides to enter sleep mode. Walking down a passageway leading into the planet, Zaphod explains to Trillian and Ford that he doesn’t always know why he’s doing something. He admits that he thinks that he stole the Heart of Gold to find Magrathea, but that he can’t be sure because his brain has been tampered with. “I freewheel a lot,” he says, claiming that he simply follows his impulses as if he’s carrying out somebody else’s plan. Curious about this phenomenon, he studied his brain one night in the spaceship’s medical bay. What he found was quite strange: “A whole section in the middle of both [of my] brains that related only to each other and not to anything else around them.” Continuing, he says: “Some bastard had cauterized all the synapses and electronically traumatized those two lumps of cerebellum.” That “bastard,” Zaphod explains, must have been him, since his own initials—Z.B.—have been burned into his brain. He thinks that he must have purposefully hidden some sort of motive, because all incoming presidents are subject to a battery of brain tests. Since the government would have discovered his intentions during these tests, he blotted them out from his own brain. As he says this, he and his friends realize that they are in a room that is slowly filling with gas, at which point they all pass out.
Meanwhile, Arthur walks around above ground and bumps into an old man named Slartibartfast who drives him in a hover car to the center of Magrathea. On the way, he explains that the entire planet’s population has just woken up from a long hibernation of sorts. “You see,” he says, “five million years ago the Galactic economy collapsed, and seeing that custom-built planets are something of a luxury commodity…,” he says, trailing off. Continuing, he says: “The recession came and we decided it would save a lot of bother if we just slept through it. So we programmed the computers to revive us when it was all over.” However, they haven’t woken up because the market has been revived, but because a race of “hyperintelligent pandimensional beings” have commissioned them to build a very lucrative project. Slartibartfast explains that millions of years ago, these beings built a computer called Deep Thought and asked it to tell them the answer to “Life, the Universe and Everything.” After 7,500,000 years of thinking, Deep Thought told them that the answer is 42. The computer then suggested—in response to the beings’ confusion—that they don’t actually understand the question they’re asking, and so the hyperintelligent beings ordered Deep Thought to build another computer capable of explaining the question to them. This computer, Slartibartfast tells Arthur, was the planet earth, and the hyperintelligent beings oversaw the experiment by taking the form of mice and monitoring humans. The project was supposed to take 10,000,000 years, but the Vogons destroyed earth five minutes before the computer finished its task.
Because Arthur is the last human in existence who was present on earth right before it was destroyed, the mice want to tap into his brain—after all, the answer they seek might be imbedded in him, since he is an organic product of the supercomputer itself (earth). Slartibartfast takes Arthur to join his friends, where they sit down for lunch and talk to Trillian’s mice, who escaped from their cage when the Heart of Gold was busy dodging Magrathea’s missiles. The mice explain that they’d like to remove Arthur’s brain to inspect it, and chaos ensues. During a struggle, alarms suddenly start to blare for no apparent reason, giving Arthur and his friends a chance to escape. After fighting several “cops,” the gang zooms off in Slartibartfast’s hover car, boards the Heart of Gold, and leaves Magrathea behind. As they zoom through space, they decide to grab a “quick bite” at the Restaurant at the End of the Universe.