Born in Pisa, Donati studied physics and astronomy at the local university with Carlo Matteucci (1811-1868) and Ottaviano Fabrizio Mossotti (1791-1863). He then moved to Florence, where he worked at La Specola, the astronomical observatory attached to the Museo di Fisica e Storia Naturale. Donati used its instruments - particularly the objectives of Giovanni Battista Amici (1786-1863) - for comet observations and searches. Having succeeded Amici as director of La Specola in 1859, he continued the spectroscopic studies begun earlier. His observations of stellar spectra were the first astrophysical studies carried out in Florence and among the first in the world. Donati also campaigned for the construction of the new Florence observatory on the hill of Arcetri.