The story of The Hitch Hiker's Guide to the Galaxy begins when a 6-foot ape descendant named Arthur Dent is saved from the destruction of planet Earth thanks to Ford Prefect, who is in fact from a small planet somewhere in the vicinity of Betlegeuse, and not from Guildford as Arthur had first thought.
Arthur Dent and Ford Prefect find themselves thrown off the Vogon spaceship into the vacuum of space. Improbably, they are rescued 29 seconds later by the Starship Heart of Gold. This brand new model has just been high-jacked by the President of the Universe, Zaphod Beeblebrox and his girlfriend Trillian. Even more unlikely, it turns out both the hitch hikers and their rescuers have met before.
Zaphod Beeblebrox is certain he's located the fabled planet of Magrathea, the richest planet of all time. Here customers could place an order to have their own dream planets constructed. Soon the 'dead planet' fires two missiles at the Starship Heart of Gold, leading Beeblebrox to deduce there must be something very valuable and hoopy worth protecting down there.
Deep down inside the planet Magrathea, coastline designer Slartibartfast is working on Earth, mark II. It seems the previous version was destroyed just before it managed to complete it's purpose. Arthur Dent, being the last human survivor to leave Earth (Trillian doesn't count), may hold the answer to Life, the Universe and Everything.
Arthur, Ford, Trillian and Zaphod travel in time by way of an exploding computer to Milliways, the Restaurant at the end of the Universe. Here people can enjoy a good meal while watching the end of all things. They soon discover that Marvin has been waiting for them for 5376000 million years. The paranoid android has taken a job parking spaceships, and Zaphod once again feels the need to swipe himself a new ride.
Zaphod has stolen Disaster Area's Stuntship which is about to plunge into a sun to form the climax to one of their typically loud concerts. Marvin is chosen to sacrifice himself by teleporting the others off the ship. It is at this point that Trillian and Zaphod disappear from the story, while Arthur and Ford end up on Golgafrincham Arkship B, heading straight for Earth.