A section of the main building, Tonbridge School
Forster was born into an Anglo-Irish and Welsh family at 6 Melcombe Place, Dorset Square, London NW1, in a building that no longer exists. He was the only child of Alice Clara "Lily" (née Whichelo) and Edward Morgan Llewellyn Forster, an architect. His name was officially registered as Henry Morgan Forster, but at his baptism he was accidentally named Edward Morgan Forster. To distinguish him from his father, he was always called Morgan. His father died of tuberculosis on 30 October 1880, before Morgan's second birthday. In 1883, Forster and his mother moved to Rooks Nest, near Stevenage, Hertfordshire. This house served as a model for Howards End, as he had fond memories of his childhood there. Among Forster's ancestors were members of the Clapham Sect, a social reform group within the Church of England.
Forster inherited £8,000 in trust (the equivalent of about £990,000 in 2017) from his paternal great-aunt Marianne Thornton (daughter of the abolitionist Henry Thornton), who died on 5 November 1887. The money was enough to live on and enabled him to become a writer. He attended as a day boy at Tonbridge School in Kent, where the school theatre has been named in his honour.
At King's College, Cambridge, between 1897 and 1901, he became a member of a discussion society known as the Apostles (formally named the Cambridge Conversazione Society). They met in secret, and discussed their work on philosophical and moral questions. Many of its members went on to constitute what came to be known as the Bloomsbury Group, of which Forster was a member in the 1910s and 1920s. There is a famous recreation of Forster's Cambridge at the beginning of The Longest Journey. The Schlegel sisters of Howards End are based to some degree on Vanessa and Virginia Stephen.
Forster was gay. In 1906 he fell in love with Syed Ross Masood, a 17-year-old future Oxford student he tutored in Latin. The Indian had more of a romantic, poetic view of friendship, confusing Forster with constant avowals of his love.
After leaving university, he travelled in continental Europe with his mother. They moved to Weybridge, Surrey, where he wrote all six of his novels. In 1914, he visited Egypt, Germany and India with the classicist Goldsworthy Lowes Dickinson, by which time he had written all but one of his novels. As a conscientious objector in the First World War, Forster served as a Chief Searcher (for missing servicemen) for the British Red Cross in Alexandria, Egypt. Though conscious of his repressed desires, it was only at this time, while stationed in Egypt, that he "lost his R [respectability]" to a wounded soldier in 1917. 
Forster spent a second spell in India in the early 1920s as the private secretary to Tukojirao III, the Maharajah of Dewas. The Hill of Devi is his non-fictional account of this period. After returning to London from India, he completed the last novel of his to be published during his lifetime, A Passage to India (1924), for which he won the James Tait Black Memorial Prize for fiction. He also edited Eliza Fay's (1756–1816) letters from India, in an edition first published in 1925.