The Hitchhiker's Guide to the Galaxy is a 2005 American comic science fiction film based on the book of the same name by Douglas Adams. It stars Martin Freeman, Sam Rockwell, Mos Def, Zooey Deschanel and the voice of [Stephen Fry]]. Shooting was completed in August 2004 and the movie was released on April 28, 2005 in Europe, Australia and New Zealand, and on the following day in Canada and United States.
The screenplay is by Adams (who died in 2001) and Karey Kirkpatrick; the film is dedicated "For Douglas."
Arthur Dent wakes up to find his house about to be demolished in order to make way for a bypass. He tries delaying the bulldozers by lying down in front of them. Ford Prefect, a friend of Arthur's, convinces him to go to the pub with him. Over a pint of beer (as "muscle relaxant"), Ford explains that he is an alien from a planet in the vicinity of Betelgeuse, and a journalist working on the Hitchhiker's Guide to the Galaxy, a universal guide book, and that the Earth is to be demolished later that day by a race called Vogons, in order to make way for a hyperspace bypass. Suddenly, a Vogon Constructor Fleet appears in the sky and destroys the planet. Ford saves himself and Arthur by hitching a ride on a Vogon ship. The two are discovered and thrown out an airlock, but are picked up by the starship Heart of Gold. They find Ford's "semi-half brother" Zaphod Beeblebrox, the President of the Galaxy. He has stolen the ship along with Tricia "Trillian" McMillan, an Earth woman whom Arthur had met previously, and Marvin the Paranoid Android.
Zaphod explains that he is seeking the planet Magrathea, where he believes he can discover the Question of Life, the Universe, and Everything to match with the answer "42" given by the supercomputer Deep Thought. Zaphod stole the Heart of Gold to use its improbability drive to get to Magrathea through trial and error.
During one of these attempts they end up on the planet Viltvodle VI. Zaphod decides to visit Humma Kavula, his opponent from the election. Upon learning of Zaphod's plan, Kavula announces that he has the coordinates to Magrathea. He takes one of Zaphod's two heads hostage and demands they bring him the Point-of-view gun created by Deep Thought, which allows the target to understand the shooter's point of view. As they are leaving the planet, Trillian is captured by Vogons. The others travel to rescue her from the Vogon home world bureaucracy, facing long lines and frustrating form processing. Trillian is outraged to learn that Zaphod signed the authorization for the destruction of Earth thinking it was a request for an autograph.
The Heart of Gold is chased by the Vogons, led by Galactic Vice-President Questular Rontok, who is attempting to rescue Zaphod from himself. As the Heart of Gold arrives in orbit above Magrathea, Arthur triggers the improbability drive to avoid the automated missile defense systems. The missiles transform into a bowl of petunias and a sperm whale.
On the planet, Zaphod, Ford and Trillian take a portal to Deep Thought. When they ask the computer whether it has calculated the ultimate question, it reveals that it designed another supercomputer to do so - Earth. When the trio finds the Point-of-View gun, Trillian shoots Zaphod, making him understand how she feels about the destruction of Earth. She also finds out how much she loves Arthur. Arthur and Marvin miss the portal and encounter a Magrathean called Slartibartfast, who takes Arthur on a tour of the construction floor where Earth Mark II is being built. Slartibartfast takes Arthur home, where the others are enjoying a feast provided by pan-dimensional beings who resemble a pair of mice. Arthur realizes he has fallen into a trap. The mice, who constructed Deep Thought, used the supercomputer to build an even larger supercomputer, the planet Earth, to determine the Ultimate Question. Believing Arthur, the last remaining supercomputer component, may hold the Ultimate Answer, the mice attempt to remove his brain. Arthur kills the mice.
As the crew regroup outside the house they are surrounded by Vogons and take shelter in a caravan as the Vogons open fire. Marvin is left outside and shot in the back of the head, and uses the Point-of-View gun on the Vogons, causing them to become depressed and unable to fight. As the Vogons are taken away and Questular rejoins with Zaphod, Arthur chooses to explore the galaxy with Trillian and lets Slartibartfast finalize the new Earth without him. The Heart of Gold crew decide to visit the Restaurant at the End of the Universe while Marvin points out they are going the wrong way.