Barrett was born in London and educated at University College school and at Ebersdorf. In 1855 he accompanied R. McAndrew on a dredging excursion from the Shetlands to Norway and beyond the Arctic Circle; and subsequently made other cruises to Greenland and to the coast of Spain, These expeditions laid the foundations of an extensive knowledge of the distribution of marine life.
In 1855 he was engaged by Sedgwick to assist in the Woodwardian Museum at Cambridge, and during the following three years he aided the professor by delivering lectures. He discovered bones of birds in the Cambridge Greensand, and he also prepared a geological map of Cambridge on the one-inch Ordnance map. In 1859, when twenty-two years of age, he was appointed director of the Geological Survey of Jamaica. He there determined the Cretaceous age of certain rocks which contained Hippurites, the new genus Barrettia being named after him by S. P. Woodward; he also obtained many fossils from the Miocene and newer strata. He was drowned at the early age of twenty-five, while investigating the sea-bottom off Kingston, Jamaica.