Ragtime is an American musical genre, enjoying its peak popularity around the years 1900-1915. Ragtime is a dance form written in 2/4 or 4/4 time, and utilizing a walking bass, that is, the bass note played legato on the 1-3 beats with a staccato chord played on the 2-4 beats. Much ragtime is written in Sonata form, with four distinct themes and a modified first theme appearing in the work. Ragtime music is syncopated, with the melodic notes landing largely on the off-beats.

The etymology of the word ragtime is not known with certainty. One theory is that the "ragged time" associated with the walking bass set against the melodic line gives the genre its name.

Ragtime was preceded by its close relative the Cakewalk, but the emergence of mature ragtime is usually dated to 1897, the year in which several important early rags were published. In 1899Scott Joplin's Maple Leaf Rag was published, which became a great hit and demonstrated more depth and sophistication than earlier ragtime. Ragtime is usually seen as one of the main precursors of jazz (along with the blues). Jazz largely surpassed ragtime in mainstream popularity in the early 1920s, although ragtime compositions continue to be written up to the present, and periodic revivals of popular interest in ragtime occurred in the 1950s and the 1970s.

Some authorities consider ragtime to be a form of classical music, though this view is not universally held. The heyday of ragtime predated the widespread availability of audio recording. Like classical music, and unlike Jazz, ragtime was and is primarily a written tradition, being distributed in sheet music rather than through recordings or by imitation of live performances. Ragtime music was also distributed via piano rolls for player pianos.

Ragtime also served as the roots for Stride piano, a more improvisational piano style popular in the 1920s and 1930s. Elements of ragtime found their way into much of the American popular music of the early 20th century.

Nearly all important ragtime compositions were composed for piano. Transcriptions for other instruments and ensembles have been made, and there are a few original ragtime compositions so scored. The best known of these is the ragtime opera, "Tremonisha," written by Scott Joplin.