Mostly Harmless is a novel by Douglas Adams and the fifth book of The Hitchhiker's Guide to the Galaxy series. It is described on the cover of the first editions as the "Fifth book in the increasingly inaccurately named 'Hitchhiker's Trilogy'".
Meanwhile, Ford Prefect has returned to the offices of the Hitchhikers' Guide, and is annoyed to find out the original publishing company has been taken over by Infinidim Enterprises. Ford discovers that Vogons are part of the Guide's employ, and attempts to escape the building. During this attempt, he finds the Hitchhiker's Guide 2.0, which he steals and sends to Arthur for safekeeping. Arthur, wanting nothing to do with the Guide, stores it away and forgets about it.
One day, Trillian arrives on Lamuella, and presents Arthur with Random Dent, a teenage girl she claims is his daughter, conceived by Trillian via artificial insemination using the only human sperm samples available, those of Arthur to pay for his space travels. Trillian leaves Random with Arthur so that she can better pursue her new career as an intergalactic reporter. Random finds life on Lamuella boring and cannot get along with Arthur, and comes across the Guide 2.0. With Random as its owner, the Guide helps her to escape the planet to find her mother. Ford appears shortly after, looking for the Guide. Together, Ford and Arthur manage to leave the planet and return to Earth, realizing that Random has also returned there.
Meanwhile, on Earth, an alternative version of Trillian, reporter Tricia McMillan, who never accepted Zaphod Beeblebrox's offer to travel in space, finds herself approached by an alien species calling themselves the Grebulons. They reveal that they have set up a base on Rupert (a tenth planet just beyond the orbit of Pluto) after arriving in the Solar System and finding that their computer core and most of their memories had been damaged, and have been following the remaining portions of their mission statement to observe the most interesting things in the system. They have approached Tricia to help them readopt the astrology charts to use Rupert as their base, offering to let her interview them on their base in exchange for the help. Tricia performs the interview but finds that the results look questionable. She is then called to report on a spaceship landing in the middle of London.
Tricia finds Random leaving the ship, and the girl believes Tricia to be her mother, and starts yelling at her. Tricia, with the help of Arthur, Ford, and Trillian, manage to take Random to a bar to try to talk to her. However, she fires a weapon at Arthur; Arthur ducks and the shot kills a man behind him. Ford points out to Arthur that the bar they in is "Stavro Mueller Beta", the man just killed being another form of Agrajag, and that Arthur's life is no longer safe, a point Arthur takes relief at. Shortly afterward, the Grebulons, believing that it would be a positive action to improve their situation, fire upon and destroy the Earth.
It is revealed that the Guide 2.0 was created by the Vogons to complete the destruction of the Earth in every possible dimension. The Guide 2.0 used reverse temporal engineering to bring together Arthur, Trillian, and Random together on Earth for its destruction by the Grebulons. After the Earth is destroyed, the Guide collapses in on itself. The book ends with assurance that this is the last entry in the Hitchhiker's Guide series.
When Adams died (due to a heart attack) on May 11, 2001, it seemed that Mostly Harmless would become the final book of what Adams called a "trilogy". However, The Salmon of Doubt was published posthumously, containing, alongside numerous articles written by Adams, several chapters belonging to a new storyline for a third "Dirk Gently" novel. In interviews that can be found in the Salmon of Doubt, Adams admitted that while he was planning on writing a third Dirk Gently book, the ideas he was having for it would have fitted better into another Hitchhikers book.
Although the complete destruction of every version of the Earth in every possible timeline, along with the death of nearly all the regular characters, would seem to make a continuation extremely unlikely, Adams had remarked that the afterlife-enhanced state of the regulars merely meant he would not have to waste time at the beginning of the next book gathering them together or explaining what they'd been up to in the intervening period.
Infinidim's head editor is named Vann Harl (though in the radio series it is in fact Zarniwoop). Ford Prefect tries to overthrow Infinidim by stealing the new guide and sending it to Arthur Dent for "safety".
The fate of Infinidim at the end of the series is unknown, though it is possible they went bankrupt due to Ford spending huge amounts of the Guide's money as part of his plan.
In the alternate ending, after the destruction of Earth, the description of the Babel fish from the earlier series is replayed with an additional section, which states that dolphins and Babel fish are acquainted, and that the dolphins' ability to travel through possibility space (first mentioned in So Long, and Thanks For All the Fish) is shared by the Babel fish as well. During the ending, Ford explains that the dolphins got taught this skill from the babel fish in exchange for knowing a good place to have parties. All the major characters are carrying Babel fish in their ears, which rescue them at the moment of Earth's destruction by transporting them to the Restaurant at the End of the Universe. The characters are reunited with Marvin, and it is revealed that beyond the Restaurant (and beyond the car park in which Marvin works) lies an endless series of blue lagoons - the final destination of the dolphins. The series ends with Arthur asking Fenchurch, "Will you come flying with me?", and her reply, "Always."
The version released on CD contains an even longer set of alternate endings, including one set after the events of the twelfth radio episode (with Arthur Dent and Lintilla), and on an alternate Earth where Arthur Dent and Fenchurch engage in a stand-off against Mr Prosser, together.