The term string quartet can refer to either a type of musical composition or a group of four people who play them. Many composers from the mid-18th century onwards wrote string quartets. The associated musical ensemble consists of two violinists, a violist, and a cellist.
The string quartet was developed into its present form by the Austrian composer Joseph Haydn, whose works in the 1750s established the ensemble as a group of four more-or-less equal partners. Since that time, the string quartet has been considered a prestigious form; writing for four instruments with broadly similar characteristics both constrains and tests a composer. String quartet composition flourished in the Classical era, and Mozart, Beethoven and Schubert each wrote a number of them. Many Romantic and early-twentieth-century composers composed string quartets, including Mendelssohn, Schumann, Brahms, Dvořák, Janáček, and Debussy. There was a slight lull in string quartet composition later in the 19th century, but it received a resurgence in the 20th century, with the Second Viennese School, Bartók, Shostakovich, Babbitt, and Carter producing highly regarded examples of the genre, and it remains an important and refined musical form.
The standard structure for a string quartet as established in the Classical era is four movements, with the first movement in sonata form, allegro, in the tonic key; a slow movement in a related key and a minuet and trio follow; and the fourth movement is often in rondo form or sonata rondo form, in the tonic key.
Some string quartet ensembles play together for many years and become established and promoted as an entity in a similar way to an instrumental soloist or an orchestra.
The early history of the string quartet is in many ways the history of the development of the genre by the Austrian composer Joseph Haydn. There had been examples of divertimenti for two solo violins, viola and cello by the Viennese composers Georg Christoph Wagenseil and Ignaz Holzbauer; and there had long been a tradition of performing orchestral works one instrument to a part. The British musicologist David Wyn Jones cites the widespread practice of four players, one to a part, playing works written for string orchestra, such as divertimenti and serenades, there being no separate (fifth) contrabass part in string scoring before the 19th century. However, these composers showed no interest in exploring the development of the string quartet as a medium. 
The origins of the string quartet can be further traced back to the Baroque trio sonata, in which two solo instruments performed with a continuo section consisting of a bass instrument (such as the cello) and keyboard. A very early example is a four-part sonata for string ensemble by the Italian composer Gregorio Allegri that might be considered an important prototype. By the early 18th century, composers were often adding a third soloist; and moreover it became common to omit the keyboard part, letting the cello support the bass line alone. Thus when Alessandro Scarlatti wrote a set of six works entitled Sonata à Quattro per due Violini, Violetta [viola], e Violoncello senza Cembalo (Sonata for four instruments: two violins, viola, and cello without harpsichord), this was a natural evolution from the existing tradition.
The musicologist Hartmut Schick has suggested that Franz Xaver Richter invented the "classical" string quartet around 1757, but the consensus amongst most authorities is that Haydn is responsible for the genre in its currently accepted form. The string quartet enjoyed no recognized status as an ensemble in the way that two violins with basso continuo – the so-called 'trio sonata' – had for more than a hundred years. Even the composition of Haydn's earliest string quartets owed more to chance than artistic imperative.
During the 1750s, when the young composer was still working mainly as a teacher and violinist in Vienna, he would occasionally be invited to spend time at the nearby castle at Weinzierl of the music-loving Austrian nobleman Karl Joseph Weber, Edler von Fürnberg. There he would play chamber music in an ad hoc ensemble consisting of Fürnberg's steward, a priest, and a local cellist, and when the Baron asked for some new music for the group to play, Haydn's first string quartets were born. It is not clear whether any of these works ended up in the two sets published in the mid-1760s and known as Haydn's Opp. 1 and 2 ('Op. 0' is a quartet included in some early editions of Op. 1, and only rediscovered in the 1930s), but it seems reasonable to assume that they were at least similar in character.
Haydn's early biographer Georg August Griesinger tells the story thus:
The following purely chance circumstance had led him to try his luck at the composition of quartets. A Baron Fürnberg had a place in Weinzierl, several stages from Vienna, and he invited from time to time his pastor, his manager, Haydn, and Albrechtsberger (a brother of the celebrated contrapuntist Albrechtsberger) in order to have a little music. Fürnberg requested Haydn to compose something that could be performed by these four amateurs. Haydn, then eighteen years old [sic], took up this proposal, and so originated his first quartet which, immediately it appeared, received such general approval that Haydn took courage to work further in this form.
Haydn went on to write nine other quartets around this time. These works were published as his Op. 1 and Op. 2; one quartet went unpublished, and some of the early "quartets" are actually symphonies missing their wind parts. They have five movements and take the form: fast movement, minuet and trio I, slow movement, minuet and trio II, and fast finale. As Ludwig Finscher notes, they draw stylistically on the Austrian divertimento tradition.
After these early efforts, Haydn did not return to the string quartet for several years, but when he did so, it was to make a significant step in the genre's development. The intervening years saw Haydn begin his employment as Kapellmeister to the Esterházy princes, for whom he was required to compose numerous symphonies and dozens of trios for violin, viola, and the bass instrument called the baryton (played by Prince Nikolaus Esterházy himself). The opportunities for experiment which both these genres offered Haydn perhaps helped him in the pursuit of the more advanced quartet style found in the eighteen works published in the early 1770s as Opp. 9, 17, and 20. These are written in a form that became established as standard both for Haydn and for other composers. Clearly composed as sets, these quartets feature a four-movement layout having broadly conceived, moderately paced first movements and, in increasing measure, a democratic and conversational interplay of parts, close-knit thematic development, and skilful though often restrained use of counterpoint. The convincing realizations of the progressive aims of the Op. 20 set of 1772, in particular, makes them the first major peak in the history of the string quartet. Certainly they offered to their own time state-of-the art models to follow for the best part of a decade; the teenage Mozart, in his early quartets, was among the composers moved to imitate many of their characteristics, right down to the vital fugues with which Haydn sought to bring greater architectural weight to the finales of nos. 2, 5 and 6.
After Op. 20, it becomes harder to point to similar major jumps in the string quartet's development in Haydn's hands, though not due to any lack of invention or application on the composer's part. As Donald Tovey put it: "with Op. 20 the historical development of Haydn's quartets reaches its goal; and further progress is not progress in any historical sense, but simply the difference between one masterpiece and the next."
The musicologist Roger Hickman has however demurred from this consensus view. He notes a change in string quartet writing towards the end of the 1760s, featuring characteristics which are today thought of as essential to the genre – scoring for two violins, viola and cello, solo passages, and absence of actual or potential basso continuo accompaniment. Noting that at this time other composers than Haydn were writing works conforming to these 'modern' criteria, and that Haydn's earlier quartets did not meet them, he suggests that "one casualty [of such a perspective] is the notion that Haydn "invented" the string quartet... Although he may still be considered the 'father' of the 'Classical' string quartet, he is not the creator of the sting quartet genre itself... This old and otiose myth not only misrepresents the achievements of other excellent composers, but also distorts the character and qualities of Haydn's opp. 1, 2 and 9".
The musicologist Cliff Eisen contextualizes the Op. 20 quartets as follows: "Haydn's quartets of the late 1760s and early 1770s [opp. 9, 17, and 20] are high points in the early history of the quartet. Characterized by a wide range of textures, frequent asymmetries and theatrical gestures...these quartets established the genre's four-movement form, its larger dimensions, and ...its greater aesthetic pretensions and expressive range."
That Haydn's string quartets were already "classics" that defined the genre by 1801 can be judged by Ignaz Pleyel's publication in Paris of a "complete" series that year, and the quartet's evolution as vehicle for public performance can be judged by Pleyel's ten-volume set of miniature scores intended for hearers rather than players – early examples of this genre of music publishing. Since Haydn's day, the string quartet has been prestigious and considered one of the true tests of a composer's art. This may be partly because the palette of sound is more restricted than with orchestral music, forcing the music to stand more on its own rather than relying on tonal color; or from the inherently contrapuntal tendency in music written for four equal instruments.
Quartet composition flourished in the Classical era. Mozart, Beethoven and Schubert each composed a number of quartets: "Beethoven in particular is credited with developing the genre in an experimental and dynamic fashion, especially in his later series of quartets written in the 1820s up until his death. Their forms and ideas inspired and continue to inspire musicians and composers, such as Wagner and Bartók." Schubert's last musical wish was to hear Beethoven's Quartet in C♯ minor, Op. 131, which he heard on 14 November 1828, just five days before his death. Upon listening to an earlier performance of this quartet, Schubert had remarked, "After this, what is left for us to write?" Wagner, when reflecting on Op. 131's first movement, said that it "reveals the most melancholy sentiment expressed in music". Of the late quartets, Beethoven cited his own favorite as Op. 131, which he saw as his most perfect single work.
Mendelssohn's six string quartets span the full range of his career, from 1828 to 1847; Schumann's three string quartets were all written in 1842 and dedicated to Mendelssohn, whose quartets Schumann had been studying in preparation, along with those of Haydn, Mozart and Beethoven. Several Romantic-era composers wrote only one quartet, while Dvořák wrote 14.
In the modern era, the string quartet played a key role in the development of Schoenberg (who added a soprano in his String Quartet No. 2), Bartók, and Shostakovich especially. After the Second World War, some composers, such as Messiaen questioned the relevance of the string quartet and avoided writing them. However, from the 1960s onwards, many composers have shown a renewed interest in the genre.
During his tenure as Master of the Queen's Music, Peter Maxwell Davies produced a set of ten entitled the Naxos Quartets (to a commission from Naxos Records) from 2001 to 2007. Margaret Jones Wiles composed over 50 string quartets. David Matthews has written eleven, and Robin Holloway both five quartets and six "quartettini". Over nearly five decades, Elliott Carter wrote a total of five string quartets; he won Pulitzer Prizes for two of them: No. 2 and No. 3. Three important string quartets were written by Helmut Lachenmann. The late 20th century also saw the string quartet expand in various ways: Morton Feldman's vast Second String Quartet is one of the longest ever written, and Karlheinz Stockhausen's Helikopter-Streichquartett is to be performed by the four musicians in four helicopters.
Quartets written during the classical period usually had four movements, with a structure similar to that of a symphony:
The positions of the slow movement and third movement are flexible. For example, in Mozart's six quartets dedicated to Haydn, three have a minuet followed by a slow movement and three have the slow movement before the minuet.
Substantial modifications to the typical structure were already present by the time of Beethoven's late quartets, and despite some notable examples to the contrary, composers writing in the twentieth century increasingly abandoned this structure. Bartók's fourth and fifth string quartets, written in the 1930s, are five-movement works, symmetrical around a central movement. Shostakovich's final quartet, written in the 1970s, comprises six slow movements.
Many other chamber groups can be seen as modifications of the string quartet:
Further expansions have also produced works such as the String octet by Mendelssohn, consisting of the equivalent of two string quartets. Notably, Schoenberg included a soprano in the last two movements of his second string quartet, composed in 1908. Adding a voice has since been done by Milhaud, Ginastera, Ferneyhough, Davies, İlhan Mimaroğlu and many others. Another variation on the traditional string quartet is the electric string quartet with players performing on electric instruments.
See also: List of string quartet composers
Notable works for string quartet include:
Main article: List of string quartet ensembles
Whereas individual string players often group together to make ad hoc string quartets, others continue to play together for many years in ensembles which may be named after the first violinist (e.g. the Takács Quartet), a composer (e.g. the Borodin Quartet) or a location (e.g. the Budapest Quartet). Established quartets may undergo changes in membership whilst retaining their original name.