Ansted was born in London on 5 February 1814 to William Ansted. He was educated at Jesus College, Cambridge, and inspired by Adam Sedgwick took an interest in geology. After taking an MA degree in 1839, he was elected to fellow of the college. He was appointed professor of geology at King's College London in 1840, holding the post until 1853. From 1845, he was also a lecturer at the East India Company's Military Seminary at Addiscombe (until its closure in 1861), and professor of geology at the College for Civil Engineers at Putney. His "Elementary Course of Geology" textbook was awarded as a prize to cadets at Addiscombe. The cadets themselves were posted to India and other colonies where some pursued geology.