The art of combining two simultaneous musical lines. The term derives from the Latin "contrapunctum" (against note). It was first used in the 14th century, when the theory of counterpoint began to develop from the older theory of discant. When one part is added to an existing one, the new part is said to be 'in counterpoint with' it. The term has sometimes been reserved for the theory or study of how one part should be added to another, but in most modern usage it is not distinct from 'polyphony' (literally meaning 'many-sounding'); there is however a tendency to apply the latter term to 16th-century usage (the period of Palestrina) and counterpoint to the early 18th century (the time of Bach).

Many early theorists discuss the rules for the addition of one line of music to one or more existing lines, for example Tinctoris (1477), Gaffurius (1496) and Zarlino (1558). The use of counterpoint in composition reached new heights in the late 15th century and the 16th with the works of such composers as Josquin, Palestrina, Lassus and Byrd. It persisted throughout the 17th century and much of the 18th, especially in church music, normally as imitative counterpoint (in which the voices imitate each other). Among the chief forms of contrapuntal music are the ricercar, canzona and fugue. A further highpoint in contrapuntal writing was reached in the music of J.S. Bach.

In Bach's time, the growing interest in music of the past led to the codification and idealization of what was supposed to be the style of Palestrina. Influential in this was J.J. Fux, who devised a system known as 'species' counterpoint in which the student learned contrapuntal facility progressively. He was given a part in long, even notes (the cantus firmus, or 'fixed song') to which he would first add another part in notes the same length, then two (or three) notes against each one, then four (or more) against each one, then a syncopated part (one against one, but moving alternately) and finally a combination of all these, so that the added part is free and florid. This may be done in two-part counterpoint or in three or more. The terms double (triple etc.) counterpoint are used for counterpoint in which two (three etc.) parts may be heard inverted, i.e. with either (any) as the upper part; this is also known as invertible counterpoint.

Composers of the Classical period were trained by such methods, and in the mature works of Mozart and Haydn counterpoint is extensively used to intensify the development sections of sonata form movements. Beethoven used fugue in some of his profoundest music, such as the 'Hammerklavier' Sonata op.1O6 and his String Quartet in sharp Minor op.131. Schubert recognized, in his last months, the value of the study of counterpoint, and there is contrapuntal writing in some of his last works, such as the String Quintet in C. Among Romantic composers, Mendelssohn was a capable contrapuntist, much influenced by Bach; Brahms and Bruckner also used counterpoint in their symphonies, as did Wagner, often for dramatic purposes, in his operas. Berlioz, though opposed to academic counterpoint, wrote contrapuntal movements of individuality in several works. Italian composers had less use for counterpoint. In the 20th century, post-Wagnerian composers such as Strauss and Mahler, as well as Schoenberg and his school (following Brahms's model), have made much use of it. Stravinsky and Hindemith, more neo-classical in style, are more directly indebted to earlier examples, particularly Bach, while some English and French composers have gone back to 16th-century models.

See also Canon and Fugue