The viola sonata is a sonata for viola, sometimes with other instruments, usually piano. The earliest viola sonatas are difficult to date for a number of reasons:
- in the Baroque era, there were many works written for the viola da gamba, including sonatas (the most famous being Johann Sebastian Bach's Three Sonatas for Viola da Gamba and Harpsichord, now most often played on the cello)
- in the Classical era and early Romantic, there were few works written with viola specifically in mind as solo instrument, and many of these, like those of the Stamitz family, may have been written for the viola d'amore, like most of their viola works—though it is now customary to play them on the viola; it was more typical to publish a work or set, like George Onslow's opus 16 cello sonatas, or Johannes Brahms's Clarinet Sonatas in the late 19th century, that specified the viola as an alternate. Two early exceptions were the viola sonata of Felix Mendelssohn (1824, posthumously published in 1966) and the opus 1 sonata of the composer Ernst Naumann (1832–1910), published in 1854.
- The viola returned to a solo role in the 20th century. Max Reger wrote three sonatas for either clarinet or viola at the beginning of the century. Paul Hindemith, himself a viola virtuoso, composed works several sonatas for viola solo, and others for viola and piano such as the Sonata for Viola and Piano, Op. 11 No. 4 in 1919. Rebecca Clarke composed the Sonata for viola and piano the same year. Bax's Viola Sonata, written (like Walton's concerto) for the great English viola player Lionel Tertis in 1923, is one of his most-played and oft-recorded chamber works. Mieczysław Weinberg wrote four viola sonatas between 1971 and 1983. The Sonata for Viola and Piano, Op. 147, is the last composition by Dmitri Shostakovich, completed in July 1975 and dedicated to Fyodor Druzhinin. György Ligeti wrote his Sonata for Solo Viola between 1991 and 1994.
- In the 21st century, Graham Waterhouse wrote a viola sonata entitled Sonata ebraica , completed in 2013.