A piano sonata is a sonata written for a solo piano. Piano sonatas are usually written in three or four movements, although some piano sonatas have been written with a single movement (Scarlatti, Liszt, Scriabin, Medtner, Berg), others with two movements (Haydn, Beethoven), some contain five (Brahms' Third Piano Sonata, Czerny's Piano Sonata No. 1) or even more movements. The first movement is generally composed in sonata form.
In the Baroque era, the use of the term "sonata" generally referred to either the sonata da chiesa (church sonata) or sonata da camera (chamber sonata), both of which were sonatas for various instruments (usually one or more violins plus basso continuo). The keyboard sonata was relatively neglected by most composers.
The sonatas of Domenico Scarlatti (of which there are over 500) were the hallmark of the Baroque keyboard sonata, though they were, for the most part, unpublished during Scarlatti's lifetime. The majority of these sonatas are in one-movement binary form, both sections being in the same tempo and utilizing the same thematic material. These sonatas are prized for both their technical difficulty and their musical and formal ingenuity. The influence of Spanish folk music is evident in Scarlatti's sonatas.
Other composers of keyboard sonatas (which were primarily written in two or three movements) include Marcello, Giustini, Durante and Platti. J.S. Bach's popular Italian Concerto, despite the name, can also be considered a keyboard sonata.
Although various composers in the 17th century had written keyboard pieces which they entitled "Sonata", it was only in the classical era, when the piano displaced the earlier harpsichord and sonata form rose to prominence as a principle of musical composition, that the term "piano sonata" acquired a definite meaning and a characteristic form.
All the well-known Classical era composers, especially Joseph Haydn, Muzio Clementi, Wolfgang Amadeus Mozart, and Ludwig van Beethoven, wrote many piano sonatas. Muzio Clementi wrote more than 110 piano sonatas. He is well known as "The Father of the Pianoforte". Clementi's Opus 2 was the first real piano sonata composed. The much younger Franz Schubert also wrote many.
The 32 sonatas of Ludwig van Beethoven, including the well-known Pathétique Sonata and the Moonlight Sonata, are often considered the pinnacle of piano sonata composition.
As the Romantic era progressed after Beethoven and Schubert, piano sonatas continued to be composed, but in lesser numbers as the form took on a somewhat academic tinge and competed with shorter genres more compatible with Romantic compositional style. Franz Liszt's comprehensive "three-movements-in-one" Sonata in B minor draws on the concept of thematic transformation first introduced by Schubert in his Wanderer Fantasie of 1822. Piano sonatas have been written throughout the 19th and 20th centuries and up to the present day.