The son of a wheelwright, he was trained as a choirboy and taken into the choir at St. Stephen's Cathedral, Vienna, where he sang from circa 1740 to circa 1750. He then worked as a freelance musician, playing the violin and keyboard instruments, accompanying for singing lessons given by the composer Porpora, who helped and encouraged him. At this time he wrote some sacred works, music for theatre comedies and chamber music. In circa 1759 he was appointed music director to Count Morzin; but he soon moved, into service as Vice-Kapellmeister with one of the leading Hungarian families, the Esterházys, becoming full Kapellmeister (on Werner's death) in 1766. He was director of an ensemble of generally some 15-20 musicians, with responsibility for the music and the instruments, and was required to compose as his employer - from 1762, Prince Nikolaus Esterházy - might command. At first he lived at Eisenstadt, circa 30 miles south-east of Vienna; by 1767 the family's chief residence, and Haydn's chief place of work, was at the new palace at Eszterháza. In his early years Haydn chiefly wrote instrumental music, including symphonies and other pieces for the twice-weekly concerts and the prince's Tafelmusik, and works for the instrument played by the prince, the baryton (a kind of viol), for which he composed circa 125 trios in ten years. There were also cantatas and a little church music. Around 1766 church music became more central, and so, after the opening of a new opera house at Eszterháza in 1768, did opera. Some of the symphonies from circa 1770 show Haydn expanding his musical horizons from occasional, entertainment music towards larger and more original pieces, for example nos.26, 39, 49, 44 and 52 (many of them in minor keys, and serious in mood, in line with trends in the contemporary symphony in Germany and Austria). Also from 1768-72 come three sets of string quartets, probably not written for the Esterházy establishment but for another patron or perhaps for publication (Haydn was allowed to write other than for the Esterházys only with permission); op.20 clearly shows the beginnings of a more adventurous and integrated quartet style.
Among the operas from this period are "Lo speziale" (for the opening of the new house), "L'infedeltà delusa" (1773) and "Il mondo della luna" (1777). Operatic activity became increasingly central from the mid-1770s as regular performances came to be given at the new house. It was part of Haydn's job to prepare the music, adapting or arranging it for the voices of the resident singers. In 1779 the opera house burnt down; Haydn composed "La fedelta premiata" for its reopening in 1781. Until then his operas had largely been in a comic genre; his last two for Eszterháza, "Orlando paladino" (1782) and "Armida" (1783), are in mixed or serious genres. Although his operas never attained wider exposure, Haydn's reputation had now grown and was international. Much of his music had been published in all the main European centres; under a revised contract with the Esterháza his employer no longer had exclusive rights to his music.
His works of the 1780s that carried his name further afield include piano sonatas, piano trios, symphonies (nos.76-81 were published in 1784-5, and nos.82-7 were written on commission for a concert organization in Paris in 1785-6) and string quartets. His influential op.33 quartets, issued in 1782, were said to be 'in a quite new, special manner': this is sometimes thought to refer to the use of instruments or the style of thematic development, but could refer to the introduction of scherzos or might simply be an advertising device. More quartets appeared at the end of the decade, op.50 (dedicated to the King of Prussia and often said to be influenced by the quartets Mozart had dedicated to Haydn) and two sets (opp.54-5 and 64) written for a former Esterházy violinist who became a Viennese businessman. All these show an increasing enterprise, originality and freedom of style as well as melodic fluency, command of form, and humour. Other works that carried Haydn's reputation beyond central Europe include concertos and notturnos for a type of hurdy-gurdy, written on commission for the King of Naples, and "The Seven Last Words", commissioned for Holy Week from Cadíz (Spain) Cathedral and existing not only in its original orchestral form but also for string quartet, for piano and (later) for chorus and orchestra.
In 1790, Nikolaus Esterházy died; Haydn (unlike most of his musicians) was retained by his son but was free to live in Vienna (which he had many times visited) and to travel. He was invited by the impresario and violinist J.P. Salomon to go to London to write an opera, symphonies and other works. In the event he went to London twice, in 1791-2 and 1794-5. He composed his last 12 symphonies for performance there, where they enjoyed great success; he also wrote a symphonie concertante, choral pieces, piano trios, piano sonatas and songs (some to English words) as well as arranging British folksongs for publishers in London and Edinburgh. But because of intrigues his opera, "L'anima del filosofo", on the Orpheus story, remained unperformed. He was honoured (with an Oxford DMus) and feted generously and played, sang and conducted before the royal family. He also heard performances of Handel's music by large choirs in Westminster Abbey.
Back in Vienna, he resumed work for Nikolaus Esterházy's grandson (whose father had now died); his main duty was to produce masses for the princess's nameday. He wrote six works, firmly in the Austrian mass tradition but strengthened and invigorated by his command of symphonic technique. Other works of these late years include further string quartets (opp.71 and 74 between the London visits, op.76 and the op.77 pair after them), showing great diversity of style and seriousness of content yet retaining his vitality and fluency of utterance; some have a more public manner, acknowledging the new use of string quartets at concerts as well as in the home. The most important work, however, is his oratorio "The Creation" in which his essentially simple-hearted joy in Man, Beast and Nature, and his gratitude to God for his creation of these things to our benefit, are made a part of universal experience by his treatment of them in an oratorio modelled on Handel's, with massive choral writing of a kind he had not essayed before. He followed this with "The Seasons", in a similar vein but more a series of attractive episodes than a whole.
Haydn died in 1809, after twice dictating his recollections and preparing a catalogue of his works. He was widely revered, even though by then his music was old-fashioned compared with Beethoven's. He was immensely prolific: some of his music remains unpublished and little known. His operas have never succeeded in holding the stage. But he is regarded, with some justice, as father of the symphony and the string quartet: he saw both genres from their beginnings to a high level of sophistication and artistic expression, even if he did not originate them. He brought to them new intellectual weight, and his closely argued style of development laid the foundations for the larger structures of Beethoven and later composers.
(See also The Symphonies of Haydn and Haydn's String Quartet Op. 20, No. 1)