Preludes and Fugues is a collection of keyboard works by German composer Johann Sebastian Bach, composed as two books in 1722 and 1742. Written in the Baroque idiom, the cycles pair preludes with contrapuntal fugues in all major and minor keys, employing extensive counterpoint and reflecting Bach's interests in tuning and keyboard technique while serving an important role in his keyboard output and in music pedagogy.