Hungarian prehistory (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 Finno-Ugric or Ugric languages around , and ended with the Hungarian conquest of the Carpathian Basin around . 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 language and the Uralic languages in the late . Thereafter, linguistics became the principal source of the study of the Hungarians' ethnogenesis. In addition, chronicles written between the , the results of archaeological research and folklore analogies provide information on the Magyars' early history.
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 . They spread over vast territories, which caused the development of a separate Proto-Finno-Ugric language by the end of the millennium. 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 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 . 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.