Back in the day, our ancestors didn't get nearly as hung up as we do on the thorny question of where, or whether, science dovetails with spiritual practice. They just got on with it, sometimes with what we would now consider to be a reckless disregard for such niceties as actual evidence. Isaac Newton (though admittedly more sensitive to the question of evidence than most) is a prime example: physicist, mathematician, natural philosopher and theologian, but also – as most people are now aware – a man with a keen interest in alchemy. It's been suggested that he suffered from Asperger's syndrome as well: he was, to put it mildly, a challenging personality.

Israel's national library has just digitised its archive of Newton's handwritten religious writings and placed it online: it amounts to some 7,500 pages. "Today, we tend to make a distinction between science and faith, but to Newton it was all part of the same world," curator Milka Levy-Rubin told an AP reporter as the online archive was launched. "He believed that careful study of holy texts was a type of science, that if analysed correctly could predict what was to come."

Newton was characteristically thorough: he learned Hebrew, and studied Kabbalism and the Talmud in order to divine future events. These recently published writings include work on the geometry of Solomon's Temple, and interpretations of the Bible. He predicted the end of the world (it's 2060, just for a change). These days, we may scoff: it's all too easy to envisage Newton as some socially challenged hacker looking up conspiracy theories on the internet. John Maynard Keynes's comment that Newton was "the last of the magicians" rather than the "first of the Age of Reason" may be inaccurate from both sides of the mirror (he certainly wasn't the last of the magicians in this country), but Keynes had a point.

Yet Newton, even at this relatively late historical stage, was by no means atypical. His belief that scripture provided a code to the natural world was one held by other commentators. The way in which all manner of apparently disparate areas of study – theology, alchemy, divination, physics, optics, healing and plain old black magic – intertwined in this particular age is itself an area of study in which both philosophers of science and historians of the esoteric have been taking some interest.

Newton was successful neither in producing the philosopher's stone or the elixir of life, although he did manage to generate a dendritic "Diana's Tree" from mercury in a solution of silver nitrate, which seems to have convinced him of some innate life within metals. But remember that alchemy was a risky undertaking in more ways than one: much of it was banned (bearing in mind its potentially destructive effects on the economy if anyone did actually succeed in making it work), and persistent European offenders could find themselves on a gallows gilded and decked with tinsel, like some gruesome Christmas tree.

In many ways, however, Newton exemplified the cautious modern approach to science. He was notoriously reluctant to publish anything about which he was unsure: a bracket into which his alchemical and religious writings largely fall. One might argue from this that he bridges the gap between magic and science rather more effectively than might otherwise appear.

Much of his alchemical work ended up in the possession of Maynard Keynes, but the religious writings passed on to a Jewish document collector, Abraham Yahuda, who turned up at the same auction in 1936. After the death of Yahuda, an intriguing polymath in his own right, his collection went to the Jerusalem National and University Library – hence this recent publication of the archives online, which can be accessed through the University of Sussex's Newton Project.