Halsted was born in Gosport, Hampshire in 1768, the third son of naval officer Captain William Anthony Halsted, and his wife Mary, "née" Frankland. Three of John's brothers had naval careers; Charles Halsted became a lieutenant and was lost with in 1780, Lawrence Halsted had a long career and became an admiral, and George Halsted rose to be a commander. John Halsted also embarked on a naval career in 1776, joining his brother Lawrence aboard their father's ship, the 60-gun , for service off North America. John was eight years old at the time. William Anthony Halsted died while in command off New York City in 1778, and John was transferred to the 32-gun , where he remained into 1779. He was then entered into a school for the next three years, rejoining the navy in 1782 as a midshipman aboard the 98-gun . The "Blenheim", commanded at this time by Captain Adam Duncan, went out to relieve Gibraltar with Admiral Lord Howe's fleet. Howe's fleet was then engaged with a Spanish force under Luis de Córdova at the Battle of Cape Spartel on 20 October 1782, in which "Blenheim" had two men killed and three wounded. Halsted then transferred to the 98-gun under Captain Jonathan Faulknor.