Donati graduated from the university of his native city, Pisa, and afterwards joined the staff of the Observatory of Florence in 1852. He was appointed director in 1864.
Donati pioneered spectroscopy of comets to determine their physical composition, in particular with the comet 1864b, which spectrum he found containing three emitting lines which would four years later be identified by William Huggins to be carbon. He discovered that the spectrum changed when a comet approached the Sun, and that heating caused it to emit its own light rather than reflected sunlight: he concluded that the composition of comets is, at least in part, gaseous. Donati was also a pioneer in the spectroscopic study of the stars and the sun.
Between 1854 and 1864 he discovered six new comets, including the spectacular Comet Donati (C/1858 L1), found in 1858.
Donati died from cholera, which he had contracted while attending a scientific convention in Vienna.
^ abGiovanni Battista DONATI. in G. F. Tricomi, Matematici italiani del primo secolo dello stato unitario, Memorie dell'Accademia delle Scienze di Torino. Classe di Scienze fisiche matematiche e naturali, serie IV tomo I, 1962.