The Well-Tempered Clavier, BWV 846–893, is a collection of two series of Preludes and Fugues in all 24 major and minor keys, composed for solo keyboard by Johann Sebastian Bach. In the German of Bach's time Clavier (keyboard) was a generic name indicating a variety of keyboard instruments, most typically a harpsichord or clavichord – but not excluding an organ either.
The modern German spelling for the collection is Das wohltemperierte Klavier (WTK; pronounced [ˌvoːlˌtɛmpəˈʁiːɐ̯tə klaˈviːɐ̯] in the Standard German of Germany). Bach gave the title Das Wohltemperirte Clavier to a book of preludes and fugues in all 24 major and minor keys, dated 1722, composed "for the profit and use of musical youth desirous of learning, and especially for the pastime of those already skilled in this study". Some 20 years later Bach compiled a second book of the same kind, which became known as The Well-Tempered Clavier, Part Two (in German: Zweyter Theil, modern spelling: Zweiter Teil).
Modern editions usually refer to both parts as The Well-Tempered Clavier, Book I (WTC I) and The Well-Tempered Clavier, Book II (WTC II), respectively. The collection is generally regarded as being among the most influential works in the history of Western classical music.
Each set contains twenty-four pairs of preludes and fugues. The first pair is in C major, the second in C minor, the third in C♯ major, the fourth in C♯ minor, and so on. The rising chromatic pattern continues until every key has been represented, finishing with a B minor fugue. The first set was compiled in 1722 during Bach's appointment in Köthen; the second followed 20 years later in 1742 while he was in Leipzig.