Born in Faenza, Sarti went to study with the famed educator and composer Padre Martini in Bologna at the age of 10. He wrote his first opera, Pompeo in Armenia, in 1752, and a trip to Copenhagen the following year as the director of an opera troupe led to his appointment by King Frederik V of Denmark as court kapellmeister in 1755. During a three-year sojourn starting in 1765, he staged dramatic works throughout Italy and briefly became maestro di coro at Ospedalle della Pieta in Venice. Until his final departure from Denmark after a political dispute in 1775, he took on a series of roles at court, chapel, and theater. Upon his return to Italy, Sarti won the title of maestro di capella of Milan Cathedral in 1779, and his operas were mounted in numerous European cities. Among the pupils attracted by his renown was Cherubini. In 1784, at Catherine the Great's invitation, Sarti traveled to St.Petersburg to succeed Paisiello as director of the Imperial Chapel. Intrigues led to his estrangement from court, though he was immediately engaged by Prince Potemkin. In a village in Ukraine awarded him by the Prince, he founded a singing school. After being reinstated at the St. Petersburg court in 1793, he was made director of a conservatory in the Italian mold, where he invented an apparatus to measure pitch.
Sarti absorbed local trends in his years abroad. In Copenhagen, he wrote Danish singspiels; in Russia, he incorporated French operatic elements of the kind fashionable at court, and utilized Russian folk music in dramatic works written in the vernacular. He was sensitive to instrumental color and was quick to exploit exotic instruments like the serpent when they were available. His music, which fell into oblivion after his death, displayed forceful contrasts and an expansive approach to tonal, modal, and chromatic elements.