The lost collection of books that kept Charles Darwin company aboard HMS Beagle and provided inspiration for his later works on evolution has been made publicly available for the first time today.

Hundreds of titles that filled the shelves of the ship's library on Darwin's five-year circumnavigation of the globe in the 1830s have been brought together and made freely available through the Darwin Online Beagle Library project.

Led by John van Wyhe, a historian of science at the National University of Singapore, a research team compiled digital copies of what they believe to be the complete set of 404 books, including thousands of stunning illustrations, that accompanied Darwin aboard HMS Beagle.

Among the titles are all 20 volumes of the Encyclopedia Britannica, seven volumes of the Natural History of Invertebrate Animals by Jean-Baptiste Lamarck, and James Cook's three-volume account of a Pacific Ocean voyage in the 1770s.

Darwin was 22 years old in 1831 when he set off for the Amazon, Patagonia and the Pacific aboard the ship. The trip around the world was planned to take two years, but the Beagle did not return to England until October 1836. His notes from the Galapagos and other destinations were central to the development of his theory of evolution through natural selection, which he described in his 1859 book, On the Origin of Species.

Darwin's voyage on the Beagle ranks as one of the most famous and important scientific voyages in history. "People have been studying it for over a hundred years using whatever materials we can to find out about it, looking at his notes, and so forth, to try and understand how he discovered the things that he did," said van Wyhe. "You can't do that without understanding what he read and what he based his findings on."

Reconstructing the library provides a more complete picture of Darwin's world during the expedition. "Darwin literally lived in the library for five years," said van Wyhe. "The science of his day was already quite sophisticated. All these geology books and all these books on fossils. Darwin could build on what was already known and what had come before."

Though most of the books aboard the Beagle were non-fiction, the library held a few works of fiction, including Milton's Paradise Lost, William Shenstone's poetry and one risqué Spanish novel Darwin is known to have read on the voyage. "He was reading a Spanish novel, which is quite amazing," said van Wyhe. "It was a Spanish novel about Queen Caroline, published in Barcelona, that was a sort of quasi-political, quasi-sexy, account of the adultery case against Caroline."

The books onboard were identified through a number of methods including letters sent between crew members and their families, lines in Darwin's notebooks and his surviving book collection. The final number of books digitised for the project is close to a number stated by Robert FitzRoy, captain of the HMS Beagle. In a letter to his sister during an earlier voyage on 16 March 1826, FitzRoy wrote, "I flatter myself I have a complete library in miniature, upwards of 400 volumes!"

According to Van Wyhe, 90% of the books may have belonged to FitzRoy, with the rest coming from the crew, and only a few brought along by Darwin. Crew members were encouraged to share books via the library for their common betterment. Wyhe believes the extensive collection were partly responsible for inspiring Darwin's later revolutionary ideas. "Just imagine, no TV, no internet, just day after day on that boat and there's nothing, just the library."