Charles Darwin's views on religion have been the subject of much interest and dispute. His pivotal work in the development of modern biology and evolution theory played a prominent part in debates about religion and science at the time. In the early 20th century his contributions became a focus of the creation–evolution controversy in the United States.

While Darwin came heavily to dispute the dogmatic prescriptions of the Anglican Church and Christianity in general, later in life he clarified his position as an agnostic in response to a letter from :

Darwin had a non-conformist Unitarian background, but attended an Anglican school. With the aim of becoming a clergyman, he went to the University of Cambridge for the required Bachelor of Arts degree, which included studies of Anglican theology. He took great interest in natural history and became filled with zeal for science as defined by John Herschel, based on the natural theology of William Paley which presented the argument from divine design in nature to explain adaptation as God acting through laws of nature. On the voyage of the Beagle he remained orthodox and looked for "centres of creation" to explain distribution, but towards the end of the voyage began to doubt that species were fixed. By this time he was critical of the Bible as history, and wondered why all religions should not be equally valid. Following his return in October 1836, he developed his novel ideas of geology while speculating about transmutation of species and thinking about religion.

Following Darwin's marriage to Emma Wedgwood in January 1839, they shared discussions about Christianity for several years, Emma's views being Unitarian like much of her family. The theodicy of Paley and Thomas Robert Malthus vindicated evils such as starvation as a result of a benevolent creator's laws which had an overall good effect. To Darwin, natural selection produced the good of adaptation but removed the need for design, and he could not see the work of an omnipotent deity in all the pain and suffering such as the ichneumon wasp paralysing caterpillars as live food for its eggs. Until 1844 he followed Paley in viewing organisms as perfectly adapted with only a few imperfections, and only partly modified that view by 1859. On the Origin of Species reflects theological views. Though he thought of religion as a tribal survival strategy, Darwin still believed that God was the ultimate lawgiver, and later recollected that at the time he was convinced of the existence of God as a First Cause and deserved to be called a theist. This view subsequently fluctuated, and he continued to explore conscientious doubts, without forming fixed opinions on certain religious matters.

Darwin continued to play a leading part in the parish work of the local church, but from around 1849 would go for a walk on Sundays while his family attended church. Though reticent about his religious views, in 1879 he responded that he had never been an atheist in the sense of denying the existence of a god, and that generally "an Agnostic would be the more correct description of my state of mind." He further stated that "Science has nothing to do with Christ, except insofar as the habit of scientific research makes a man cautious in admitting evidence. For myself, I do not believe that there ever has been any revelation. As for a future life, every man must judge for himself between conflicting vague probabilities."

Darwin's religious background

Darwin was born during the Napoleonic Wars and grew up in their aftermath, a conservative time when Tory-dominated government closely associated with the established Anglican Church of England repressed Radicalism, but when family memories recalled the 18th-century Enlightenment and a multitude of Non-conformist churches held differing interpretations of Christianity. His Whig-supporting extended family of Darwins and Wedgwoods was strongly Unitarian, though one of his grandfathers, Erasmus Darwin, was a freethinker, and his father was quietly a freethinker but as a physician avoided any social conflict with his wealthy Anglican patrons. While Darwin's parents were open enough to changing social pressures to have Charles baptised in the Church of England, his pious mother took the children to the Unitarian chapel. After her death when he was only eight he became a boarder at Shrewsbury School, an Anglican public school.

Edinburgh – medical studies and Lamarckian evolution theory The two universities in England, namely Oxford and Cambridge, were under the Church of England and required students to sign the Thirty-nine Articles of the Anglican faith, so many English Non-conformists sent their children to the Scottish universities which had a better reputation in fields like medicine. Darwin initially attended the University of Edinburgh, and while he was put off medicine he took an active interest in natural history at the Plinian Society. One of his proposers for the society was the radical William A. F. Browne, and on 27 March 1827 Browne argued that mind and consciousness were simply aspects of brain activity, not "souls" or spiritual entities separate from the body. A furious debate ensued, and later someone struck out all mention of this materialist heresy from the minutes. This was the first time that Darwin was exposed to militant freethought and the arguments it aroused. On one occasion Robert Edmond Grant discussed Lamarck's evolutionary ideas. Darwin was astonished, but had recently read the similar ideas of his grandfather Erasmus and remained indifferent.

Natural history had grown from the idea that the different kinds of plants and animals showed the wonder of God's creation, making their study and cataloguing into species worthwhile. In Darwin's day it was common for clergymen to be naturalists, though scientific findings had already opened up ideas on creation. The established churches (of England and Scotland) and the English universities remained insistent that species were divinely created and man was distinct from the "lower orders", but the Unitarian church rejected this teaching and even proclaimed that the human mind was subject to physical law. Erasmus Darwin went further and his Zoönomia asks "…would it be too bold to imagine that all warm-blooded animals have arisen from one living filament, which the great First Cause endued with animality… possessing the faculty of continuing to improve by its own inherent activity, and of delivering down these improvements by generation to its posterity, world without end!", anticipating Lamarckism.

Cambridge – theology and geology When Darwin proved unable to persevere at medical studies, his father sent him to Christ's College, Cambridge, for a Bachelor of Arts degree as the first step towards becoming an Anglican parson. Darwin was at first uncertain, he later wrote: "from what little I had heard and thought on the subject I had scruples about declaring my belief in all the dogmas of the Church of England; though otherwise I liked the thought of being a country clergyman. Accordingly I read with care 'Pearson on the Creed' and a few other books on divinity; and as I did not then in the least doubt the strict and literal truth of every word in the Bible, I soon persuaded myself that our Creed must be fully accepted. It never struck me how illogical it was to say that I believed in what I could not understand and what is in fact unintelligible. I might have said with entire truth that I had no wish to dispute any dogma; but I never was such a fool as to feel and say 'credo quia incredibile". He was particularly convinced by the reasoning of John Bird Sumner's Evidences of Christianity which set out the logic that the unbelief of sceptics gave them the dilemma that if Christianity were untrue, then either "Jesus did not live, or he actually lived, but was not the Son of God, hence an imposter." The Gospels made this highly improbable, as his miracles had convinced unbelievers, hence we had "no right to deny" that such events were probable. Jesus's religion was "wonderfully suitable… to our ideas of happiness in this & the next world" and there was "no other way… of explaining the series of evidence & probability."

The university was essentially tied into the Church of England, with virtually all of the college heads and most of the professors and fellows having been ordained. About half of the undergraduates were destined for the church, like Darwin hoping for a comfortable parish. During Darwin's second year, the harmony was disturbed when Cambridge was briefly visited by the Radicals Richard Carlile and the Revd Robert Taylor on an "infidel home missionary tour", causing a stir before being banned. Taylor would be remembered by Darwin as "the Devil's Chaplain", a warning example of an outcast from society who had challenged Christianity and had been imprisoned for blasphemy.

In his third year, he joined John Stevens Henslow's natural history course and was introduced to the Cambridge version of natural theology, part of the liberal Christianity of colleagues such as Adam Sedgwick, George Peacock and William Whewell who all had strong views about science as the search for the laws of nature. Study of nature was study of the work of the Lord, and scientists who were ordained clerics of the Church of England, such as themselves, could follow their enquiries without theological difficulties. Sedgwick gave a talk to the Geological Society of London in 1831 which declared that "No opinion can be heretical, but that which is not true… Conflicting falsehoods we can comprehend; but truths can never war against each other. I affirm, therefore, that we have nothing to fear from the results of our enquiries, provided they be followed in the laborious but secure road of honest induction. In this way we may rest assured that we shall never arrive at conclusions opposed to any truth, either physical or moral, from whatever source that truth may be derived." For these men, science could not be out of harmony with religion, and in a sense it was religion.

Under pressure in the fourth year, Darwin worked hard at his studies, getting tuition in theology by Henslow. Darwin became particularly interested in the Revd William Paley's Evidences of Christianity and Principles of Moral and Political Philosophy, which were set texts. The latter was becoming outdated. It opposed arguments for increased democracy, but saw no divine right of rule for the sovereign or the state, only "expediency". Government could be opposed if grievances outweighed the danger and expense to society. The judgement was "Every man for himself". These ideas had suited the conditions of reasonable rule prevailing when the text was published in 1785, but in 1830 they were dangerous ideas at a time when the French king was deposed by middle class republicans and given refuge in England by the Tory government, and resulting radical street protests demanded suffrage, equality and freedom of religion. Paley's text even supported abolition of the Thirty-nine Articles of the Anglican faith which every student at Cambridge (and Oxford University) was required to sign. Henslow insisted that "he should be grieved if a single word of the Thirty-nine Articles were altered" and emphasised the need to respect authority. Darwin later wrote that he was convinced that he "could have written out the whole of the Evidences with perfect correctness, but not of course in the clear language of Paley. The logic of this book and as I may add of his Natural Theology gave me as much delight as did Euclid."