The organ sonatas, BWV 525–530 by Johann Sebastian Bach are a collection of six sonatas in trio sonata form. Each of the sonatas has three movements, with three independent parts in the two manuals and obbligato pedal. The collection was put together in Leipzig in the late 1720s and contained reworkings of prior compositions by Bach from earlier cantatas, organ works and chamber music as well as some newly composed movements. The sixth sonata, BWV 530, is the only one for which all three movements were specially composed for the collection. When played on an organ, the second manual part is often played an octave lower on the keyboard with appropriate registration. Commentators have suggested that the collection might partly have been intended for private study to perfect organ technique, some pointing out that its compass allows it to be played on a pedal clavichord. The collection of sonatas is generally regarded as one of Bach's masterpieces for organ. The sonatas are also considered to be amongst his more difficult compositions for the instrument.
The organ sonatas were first gathered together in Leipzig in an autograph manuscript which Bach scholars have dated to a period roughly between 1727 and 1730. Apart from the heading with the numbering of the six sonatas and an indication of where the manuscript ends, Bach himself left no further specifications. After Bach's death, the musician Georg Poelchau (1773–1836) produced a covering page for the collection (along with the Great Eighteen Chorale Preludes) with a title and commentary.
The sonatas were described by Bach's biographer Johann Nikolaus Forkel as follows:
Poelchau's commentary on the covering page is a direct quotation of this passage from Forkel.
The organ sonatas represent the culmination of Bach's collections of keyboard works with a partly didactic purpose, from the point of both playing and composition. Although intended initially for Bach's eldest son Wilhelm Friedemann Bach, they also became part of the staple repertoire of his students. The keyboard collections include the Orgelbüchlein, the two and three part inventions, the first book of the Well Tempered Clavier, the French Suites and the Six partitas (Clavier–Übung I).