Hungarian prehistory (Hungarian: magyar őstörténet) spans the period of history of the Hungarian people, or Magyars, which started with the separation of the Hungarian language from other Ugric languages around 800 BC, and ended with the Hungarian conquest of the Carpathian Basin around 895 AD. Based on the earliest records of the Magyars in Byzantine, Western European, and Hungarian chronicles, scholars considered them for centuries to have been the descendants of the ancient Scythians and Huns. This historiographical tradition disappeared from mainstream history after the realization of similarities between the Hungarian and Uralic languages in the late 18th century. After the 2000s, archaeological research aimed at exploring the early history of the Hungarians resumed, with a primary focus on the Ural Mountains and Siberia. Today, these efforts are regularly supplemented with archaeogenetic studies. In addition to linguistics, archaeology, and archaeogenetics, the re-evaluation of well-known written sources has also begun. Together, these fields of study may provide new information regarding the origins of the Hungarian people.
Study of pollen in fossils based on cognate words for certain trees – including larch and elm – in the daughter languages suggests the speakers of the Proto-Uralic language lived in the wider region of the Ural Mountains, which were inhabited by scattered groups of Neolithic hunter-gatherers in the 4th millennium BC. Linguistic studies and archaeological research evidence that those who spoke this language lived in pit-houses and used decorated clay vessels. The expansion of marshlands after around 2600 BC caused new migrations. No scholarly consensus on the Urheimat, or original homeland, of the Ugric peoples exists: they lived either in the region of the Tobol River or along the Kama River and the upper courses of the Volga River around 2000 BC. They lived in settled communities, cultivated millet, wheat, and other crops, and bred animals – especially horses, cattle, and pigs. Loan words connected to animal husbandry from Proto-Iranian show that they had close contacts with their neighbors. The southernmost Ugric groups adopted a nomadic way of life by around 1000 BC, because of the northward expansion of the steppes.