He began lessons with his mother, who brought up the family after his father's death in 1888. In 1894 they settled in Bratislava, where he attended the Gymnasium (Dohnányi was an elder schoolfellow), studied the piano with László Erkel and Anton Hyrtl, and composed sonatas and quartets. In 1898 he was accepted by the Vienna Conservatory, but following Dohnányi he went to the Budapest Academy (1899-1903), where he studied the piano with Liszt's pupil István Thoman and composition with János Koessler. There he deepened his acquaintance with Wagner, though it was the music of Strauss, which he met at the Budapest premiere of Also sprach Zarathustra in 1902, that had most influence. He wrote a symphonic poem, Kossuth (1903), using Strauss's methods with Hungarian elements in Liszt's manner.
In 1904 Kossuth was performed in Budapest and Manchester; at the same time Bartók began to make a career as a pianist, writing a Piano Quintet and two Lisztian virtuoso showpieces (Rhapsody op.1, Scherzo op.2). Also in 1904 he made his first Hungarian folksong transcription. In 1905 he collected more songs and began his collaboration with Kodály: their first arrangements were published in 1906. The next year he was appointed Thoman's successor at the Budapest Academy, which enabled him to settle in Hungary and continue his folksong collecting, notably in Transylvania. Meanwhile his music was beginning to be influenced by this activity and by the music of Debussy that Kodály had brought back from Paris: both opened the way to new, modal kinds of harmony and irregular metre. The 1908 Violin Concerto is still within the symphonic tradition, but the many small piano pieces of this period show a new, authentically Hungarian Bartók emerging, with the 4ths of Magyar folksong, the rhythms of peasant dance and the scales he had discovered among Hungarian, Romanian and Slovak peoples. The arrival of this new voice is documented in his String Quartet no.1 (1908), introduced at a Budapest concert of his music in 1910.
There followed orchestral pieces and a one-act opera, Bluebeard's Castle, dedicated to his young wife. Influenced by Mussorgsky and Debussy but most directly by Hungarian peasant music (and Strauss, still, in its orchestral pictures), the work, a grim fable of human isolation, failed to win the competition in which it was entered. For two years (1912-14) Bartok practically gave up composition and devoted himself to the collection, arrangement and study of folk music, until World War I put an end to his expeditions. He returned to creative activity with the String Quartet no.2 (1917) and the fairytale ballet The Wooden Prince, whose production in Budapest in 1917 restored him to public favour. The next year Bluebeard's Castle was staged and he began a second ballet, The Miraculous Mandarin, which was not performed until 1926 (there were problems over the subject, the thwarting and consummation of sexual passion). Rich and graphic in invention, the score is practically an opera without words.
While composing The Mandarin Bartók came under the influence of Stravinsky and Schönberg, and produced some of his most complex music in the two violin sonatas of 1921-2. At the same time he was gaining international esteem: his works were published by Universal Edition and he was invited to play them all over Europe. He was now well established, too, at home. He wrote the confident Dance Suite (1923) for a concert marking the 50th anniversary of Budapest, though there was then another lull in his composing activity until the sudden rush of works in 1926 designed for himself to play, including the Piano Concerto no.1, the Piano Sonata and the suite Out of Doors. These exploit the piano as a percussion instrument, using its resonances as well as its xylophonic hardness. The search for new sonorities and driving rhythms was continued in the next two string quartets (1927-8), of which no.4, like the concerto, is in a five-section palindromic pattem (ABCBA).
Similar formal schemes, with intensively worked counterpoint, were used in the Piano Concerto no.2 (1931) and String Quartet no.5 (1934), though now Bartók's harmony was becoming more diatonic. The move from inward chromaticism to a glowing major (though modally tinged) tonality is basic to the Music for Strings, Percussion and Celesta (1936) and the Sonata for Two Pianos and Percussion (1937), both written for performance in Switzerland at a time when the political situation in Hungary was growing unsympathetic.
In 1940 Bartók and his second wife (he had divorced and remarried in 1923) sadly left war-torn Europe to live in New York, which he found alien. They gave concerts and for a while he had a research grant to work on a collection of Yugoslav folksong, but their finances were precarious, as increasingly was his health. It seemed that his last European work the String Quartet no.6 (1939), might be his pessimistic swansong, but then came the exuberant Concerto for Orchestra (1943) and the involuted Sonata for solo violin (1944). Piano Concerto no.3, written to provide his widow with an income, was almost finished when he died, a Viola Concerto left in sketch.