The Lord of the Rings started as a sequel to J. R. R. Tolkien's work The Hobbit, published in 1937. The popularity of The Hobbit had led George Allen & Unwin, the publishers, to request a sequel. Tolkien warned them that he wrote quite slowly, and responded with several stories he had already developed. Having rejected his contemporary drafts for The Silmarillion, putting on hold Roverandom, and accepting Farmer Giles of Ham, Allen & Unwin thought more stories about hobbits would be popular. So at the age of 45, Tolkien began writing the story that would become The Lord of the Rings. The story would not be finished until 12 years later, in 1949, and would not be fully published until 1955, when Tolkien was 63 years old.
Persuaded by his publishers, he started "a new Hobbit" in December 1937. After several false starts, the story of the One Ring emerged. The idea for the first chapter ("A Long-Expected Party") arrived fully formed, although the reasons behind Bilbo's disappearance, the significance of the Ring, and the title The Lord of the Rings did not arrive until the spring of 1938. Originally, he planned to write a story in which Bilbo had used up all his treasure and was looking for another adventure to gain more; however, he remembered the Ring and its powers and thought that would be a better focus for the new work. As the story progressed, he also brought in elements from The Silmarillion mythology.
Writing was slow, because Tolkien had a full-time academic position, and needed to earn further money as a university examiner. Tolkien abandoned The Lord of the Rings during most of 1943 and only restarted it in April 1944, as a serial for his son Christopher Tolkien, who was sent chapters as they were written while he was serving in South Africa with the Royal Air Force. Tolkien made another concerted effort in 1946, and showed the manuscript to his publishers in 1947. The story was effectively finished the next year, but Tolkien did not complete the revision of earlier parts of the work until 1949. The original manuscripts, which total 9,250 pages, now reside in the J. R. R. Tolkien Collection at Marquette University.
The influence of the Welsh language, which Tolkien had learned, is summarized in his essay English and Welsh: "If I may once more refer to my work. The Lord of the Rings, in evidence: the names of persons and places in this story were mainly composed on patterns deliberately modelled on those of Welsh (closely similar but not identical). This element in the tale has given perhaps more pleasure to more readers than anything else in it."
The Lord of the Rings developed as a personal exploration by Tolkien of his interests in philology, religion (particularly Roman Catholicism), fairy tales, Norse and general Germanic mythology, and also Celtic, Slavic, Persian, Greek, and Finnish mythology. Tolkien acknowledged, and external critics have verified, the influences of George MacDonald and William Morris and the Anglo-Saxon poem Beowulf. The question of a direct influence of Wagner's The Nibelung's Ring on Tolkien's work is debated by critics.
Tolkien included neither any explicit religion nor cult in his work. Rather the themes, moral philosophy, and cosmology of The Lord of the Rings reflect his Catholic worldview. In one of his letters Tolkien states, "The Lord of the Rings is of course a fundamentally religious and Catholic work; unconsciously so at first, but consciously in the revision. That is why I have not put in, or have cut out, practically all references to anything like 'religion', to cults or practices, in the imaginary world. For the religious element is absorbed into the story and the symbolism."
Some locations and characters were inspired by Tolkien's childhood in Birmingham, where he first lived near Sarehole Mill, and later near Edgbaston Reservoir. There are also hints of the Black Country, which is within easy reach of north west Edgbaston. This shows in such names as "Underhill", and the description of Saruman's industrialization of Isengard and The Shire. It has also been suggested that The Shire and its surroundings were based on the countryside around Stonyhurst College in Lancashire where Tolkien frequently stayed during the 1940s. The work was influenced by the effects of his military service during World War I, to the point that Frodo has been "diagnosed" as suffering from Posttraumatic Stress Disorder, or "shell-shock", which was first diagnosed under that name at the Battle of the Somme, at which Tolkien served.