The Hitchhiker's Guide to the Galaxy concerns Arthur Dent, an Englishman who is dragged along on a galactic adventure by his friend Ford, an alien, when the Earth is suddenly blown up. As Arthur is unwillingly flung through space and time, meeting talking mice, a depressed robot, and the man who rules the universe along the way, he discovers that the galaxy is a stranger place than he could have possibly imagined. Major themes in this comic novel are fate, free will, and the purpose of life.
The book begins with council workmen arriving at Arthur Dent's house. They wish to demolish his house in order to build a bypass.
Arthur's best friend, Ford Prefect, arrives, warning him of the end of the world. The two head to a pub, where the locals question Ford's knowledge of the Apocalypse. An alien race, known as Vogons, show up to demolish the planet, in order to build a bypass, and Arthur and Ford manage to get on their ship just before Earth is demolished, where they are forced to listen to Vogon poetry as punishment. Arthur tries to say it is beautiful to avoid being thrown out of an airlock with Ford.
Arthur and Ford are then placed into the airlock, and jettisoned into space, only to be rescued by Zaphod Beeblebrox's ship, the Heart of Gold . Zaphod, a semi-cousin of Ford, is the President of the Galaxy, accompanied by a depressed robot named Marvin and a human woman by the name of Trillian. The five embark on a journey to find the legendary planet known as Magrathea, known for selling luxury planets. Once there, they are taken into the planet's centre by a man named Slartibartfast. There, they learn that a supercomputer named Deep Thought, who determined the ultimate answer to life, the universe, and everything to be the number 42, created Earth as an even greater computer to calculate the question to which 42 is the answer.
Trillian's mice, actually part of the group of superbeings that had Earth created in the first place, reject the idea of building a second Earth to redo the process, and offer to buy Arthur's brain in the hope that it contains the answer, leading to a fight when he declines. Zaphod saves Arthur when the brain is about to be removed, and the group decides to go to the Restaurant at the End of the Universe.