The Art of Fugue (or The Art of the Fugue; German: Die Kunst der Fuge), BWV 1080, is an incomplete work of unspecified instrumentation by Johann Sebastian Bach (1685–1750). Written in the last decade of his life, The Art of Fugue is the culmination of Bach's experimentation with monothematic instrumental works.
This work consists of 14 fugues and 4 canons in D minor, each using some variation of a single principal subject, and generally ordered to increase in complexity. "The governing idea of the work", as put by Bach specialist Christoph Wolff, "was an exploration in depth of the contrapuntal possibilities inherent in a single musical subject." The word "contrapunctus" is often used for each fugue.
The earliest extant source of the work is an autograph manuscript of the early 1740s, containing 12 fugues and 2 canons. This autograph is typically referred to by its call number of P200 in the Berlin State Library. Three manuscripts for pieces that appear in the revised edition were bundled with P200 at some point before its acquisition by the library.
The revised version was published in May 1751, slightly less than a year after Bach's death. In addition to changes in the order, notation, and material of pieces which appeared in the autograph; it contained 2 new fugues, 2 new canons, and 3 pieces of ostensibly spurious inclusion. A second edition was published in 1752, but differed only in its addition of a preface by Friedrich Wilhelm Marpurg.
In spite of its revisions, the printed edition of 1751 contained a number of glaring editorial errors. The majority of these may be attributed to Bach's relatively sudden death in the midst of publication. Three pieces were included that do not to appear to have been part of Bach's intended order: an unrevised (and thus redundant) version of the second double fugue, Contrapunctus X; a two-keyboard arrangement of the first mirror fugue, Contrapunctus XIII; and a chorale harmonization "Vor deinen Thron tret ich hiermit" ("Herewith I come before Thy Throne"), derived from BWV 668a, and noted in the introduction to the edition as a recompense for the work's incompleteness, having purportedly been dictated by Bach on his deathbed.