Born in Kecskemét, Kodály learned to play the violin as a child.
In 1905 he visited remote villages to collect songs, recording them on phonograph cylinders. In 1906 he wrote the thesis on Hungarian folk song ("Strophic Construction in Hungarian Folksong"). Around this time Kodály met fellow composer Béla Bartók, whom he took under his wing and introduced to some of the methods involved in folk song collecting. The two became lifelong friends and champions of each other's music.
All these works show a great originality of form and content, a very interesting blend of highly sophisticated mastery in the Western-European style of music, including classical, late-romantic, impressionistic and modernist tradition and at the other hand profound knowledge and respect for the folk music in Hungary and the Hungarian-inhabited areas of Slovakia and Romania. Partly because of the Great War and subsequent major geopolitical changes in the region, partly because of a naturally rather diffident temperament in youth, Kodály had no major public success until 1923. This was the year when one of his best-known pieces, Psalmus Hungaricus, was given its first performance at a concert to celebrate the fiftieth anniversary of the union of Buda and Pest (Bartók's Dance Suitepremiered on the same occasion.)
Kodály's first wife was Emma Gruber (née Schlesinger, later Sándor), the dedicatee of Ernő Dohnányi's Waltz for piano four-hands, Op. 3, and Variations and Fugue on a theme by E.G., Op. 4 (1897). In November 1958, after 48 years of the most harmonious marriage Kodály's first wife Emma died. In December 1959, Kodály married Sarolta Péczely, his 19-year-old student at the Franz Liszt Academy of Music with whom he lived happily until his death in 1967 at the age of 84.
In 1966, Kodály toured the United States and gave a special lecture at Stanford University, where some of his music was performed in his presence.