Bartók was born in Nagyszentmiklos, Hungary (now Sînnicolau Mare, Romania). He was taught music by his mother at an early age and he made his first public appearance as a pianist at the age of ten. He later studied piano under Istvan Thoman and composition under Hans Koessler at the Royal Academy of Music in Budapest. There he met Zoltan Kodaly and together they collected folk music from the region. This was to have a major impact on his style. Previously, Bartók's idea of Hungarian folk music was derived from the gypsy melodies to be found in the works of Franz Liszt, and in 1903 Bartók had written a large orchestral work, Kossuth which incorporated such melodies. Upon discovering peasant folk song, which Bartók regarded as true Hungarian folk music, he began to incorporate folk songs into his own compositions and write original folk-like tunes, as well as frequently using folksy rhythmic figures.
This new style emerged over the next few years. Bartók was building a career for himself as a pianist, when in 1907 he landed a job as piano professor at the Royal Academy. This allowed him to stay in Hungary rather than having to tour Europe as a pianist, and also allowed him to collect more folk songs. His large scale orchestral works were still in the manner of Johannes Brahms or Richard Strauss, but he wrote a number of small piano pieces which show his growing interest in folk music. Probably the first piece to show clear signs of this new interest is the String Quartet No. 1 (1908), which has several folksy elements in it.
In 1911, Bartók wrote what was to be his only opera, Bluebeard's Castle. He entered it for a prize awarded by the Hungarian Fine Arts Commission, but they said it was unplayable, and rejected it out of hand. The opera remained unperformed until 1918, when Bartók was pressurised by the government to remove the name of the librettist, Béla Balázs, from the program on account of his political views. Bartók refused, and eventually withdrew the work. For the rest of his life, Bartók did not feel greatly attached to the government or institutions of Hungary, although his love affair with its folk music continued.
After his disappointment over the Fine Arts Commission prize, Bartók wrote very little for two or three years, preferring to concentrate on folk music collecting and arranging. However, the outbreak of World War I forced him to stop these expeditions, and he returned to composing, writing the ballet The Wooden Prince in 1914-16 and the String Quartet No. 2 in 1915-17. It was The Wooden Prince which gave him some degree of international fame.
Bartók subsequently worked on another ballet The Miraculous Mandarin and followed this up with his two violin sonatas which are harmonically and structurally some of the most complex pieces he wrote. He wrote his third and fourth string quartets, regarded as some of the finest string quartets ever written, in 1927-28, after which his harmonic language began to become simpler. The String Quartet No. 5 (1934) is somewhat more traditional from this point of view. Bartok wrote his sixth and last string quartet in 1939.
It was to be the last piece he wrote in Europe. In 1940, after the outbreak of World War II, Bartók reluctantly moved to the USA. He did not feel comfortable there, and found it very difficult to write. His last work may well have been the String Quartet No. 6, were it not for Serge Koussevitsky commissioning him to write the Concerto for Orchestra. This seemed to reawaken his interest in composing, and he went on to write his Piano Concerto No. 3, an airy and almost neo-classical work, and begin work on his Viola Concerto.
Interred in the Ferncliff Cemetery in Hartsdale, New York, with the fall of communism forty-three years after his death, his remains were transferred to Budapest, Hungary for a state funeral on July 7, 1988 with internment in Budapest's Farkasreti Cemetery.