Born in Calcutta, he was the son of William Ritchie, Advocate General of Bengal. At a young age he moved to Paris to be raised by his aunt. In 1862 he travelled to England for the first time, entering a private boarding school in Warwickshire, and then Winchester School from 1866-72.
In 1873 he passed the entrance examinations for the Indian Civil Service. He took a two-year course in law, political economy, Indian history and three Indian languages at Trinity College, Cambridge.
In 1875 he sailed to India, In 1882 he married Amy Thackeray, daughter of Colonel Sir Edward Talbot Thackeray in Roorkee, nothern India.He remained in India until 1896, rising to be head of the Calcutta Municipality.
On 23 January 1902 he was co-opted onto the London School Board to fill a casual vacancy in the representation of Westminster. The school board was abolished two years later.