 His elder brother was Sir James Cosmo Melvill; Philip Melvill and Sir Peter Melvill were his younger brothers.He was born in Pendennis Castle, Cornwall, on 14 September 1798 and became a sizar of St. John's College, Cambridge, in October 1817.After migrating to Peterhouse, he passed as second wrangler and won the Smith's Prize in 1821, and was a fellow and tutor of his college from 1822 to 1832.