The English name Hungary is an exonym for the nation and territory of the same name. The name is derived from Medieval Latin Hungaria, which itself derives from the ethnonyms (H)ungarī, Ungrī, and Ugrī. Medieval authors denominated the Hungarians as Hungaria, but the Hungarians even contemporarily denominate themselves Magyars and their homeland Magyarország.
Primary sources use several names for the Magyars/Hungarians. However, their original historical endonym/ethnonym — the name they used to refer to themselves in the Early Middle Ages — is uncertain. In sources written in Arabic, the Magyars are denominated Madjfarīyah or Madjgharīyah, for example by Ahmad ibn Rustah; Badjghird or Bazkirda, such as by al-Mas’udi; Unkalī by al-Tartushi, for instance; and Turk, by sources like ibn Hayyan). In Byzantine sources, the Magyars are called Οΰγγροι Ungroi; Τουρκοι Turkoi, by Emperor Leo VI "the Wise", for example; and Σάβαρτοι άσφαλοι Sawartoi asfaloi, such as by Emperor Constantine VII Porphyrogennetos. When referencing the Magyars, the Medieval Latin sources usually use Ungri, Hungri, Ungari, and Hungari, but some of the sources call them Avari or Huni.