The name of Iran derives immediately from Middle Persian Ērān, Pahlavi ʼyrʼn, first attested in this form in the inscription that accompanies the investiture relief of Ardashir I at Naqsh-e Rustam. In this inscription, the king's Middle Persian appellation is ardašīr šāhān šāh ērān corresponding to the passage ardašīr šāhān šāh aryān in the Parthian inscription accompanying the Middle Persian one. Both means "Ardashir, king of kings of Aryans". Though in English the name Persia was once the norm, Iran is today the preferred name.
The gentilic ēr- and ary- (in e.g. ērān/aryān) in the Middle Iranian languages of Persian and Parthian derives from Old Iranian *arya- (in e.g. Old Persian: ariya-, Avestan: airiia-, etc.), meaning "Aryan," in the sense of "of the Iranians." This word (i.e. *arya-) is attested as an ethnic designator in Achaemenid inscriptions and in Zoroastrianism's Avesta tradition,[n 1] and in Middle Iranian era (ca. 400 BCE - 700 CE) it seems "very likely" that the word ērān in Ardashir's inscription still retained the same meaning as in the Old era, i.e. denoting the people rather than the empire while the empire was properly named as ērānšahr.
Notwithstanding this inscriptional use of ērān to refer to the Iranian peoples, the use of ērān to refer to the empire (and the antonymic anērān to refer to the Roman territories) is also attested by the early Sassanid period. Both ērān and anērān appear in 3rd century calendrical text written by Mani. In an inscription of Ardashir's son and immediate successor, Shapur I "apparently includes in Ērān regions such as Armenia and the Caucasus which were not inhabited predominantly by Iranians." In Kartir's inscriptions (written thirty years after Shapur's), the high priest includes the same regions (together with Georgia, Albania, Syria and the Pontus) in his list of provinces of the antonymic Anērān. Ērān also features in the names of the towns founded by Sassanid dynasts, for instance in Ērān-xwarrah-šābuhr "Glory of Ērān (of) Shapur". It also appears in the titles of government officers, such as in Ērān-āmārgar "Accountant-General (of) Ērān" or Ērān-dibirbed "Chief Scribe (of) Ērān".
Shapur's trilingual inscription at Ka'ba-i Zartosht also introduces the term ērānšahr (), "kingdom of the Iranians", that is however not attested in any other texts of this period other than in royal inscriptions (it is however preserved in post-Sassanid-era Zoroastrian texts[n 2]). Because an equivalent of ērānšahr does not appear in Old Iranian (where it would have been *aryānām xšaθra- or in Old Persian *- xšaça-, "rule, reign, sovereignty"), the term is presumed to have been a Sassanid-era development. In the Greek portion of Shapur's trilingual inscription the word šahr "kingdom" appears as ethnous "nation". For speakers of Greek, the idea of an Iranian ethnous was not new: In the 1st century BCE, Strabo had noted a relationship between the various Iranian peoples and their languages: "[From] beyond the Indus [...] Ariana is extended so as to include some part of Persia, Media, and the north of Bactria and Sogdiana; for these nations speak nearly the same language." (Geography, 15.2.1-15.2.8).
Usage in the medieval Islamic period 
The name "Aria"(etymologically equivalent to Iran) is also attest in this period. Hamza Isfahani (894-970) in his book "history of the Prophets and Saints" mentions:Arian which is the same as Persia is situation in the middle of these six countries and these six countries form its borders. Its SE is China, its North is bordered by the lands of Turk, Its Southern Middle borders India, Its Northern Middle borders Byzantium, its SW borders Africa and its NW is in the hand of Berbers.
جو بر پیوستنش بر دل نهادم
فراوان رایها بر دل گشادم
که چون گویمش من تا دیر نماند
وُ هرکس دانش او بداند
بگویم تازی ار نه پارسی نغز
ز هر در بگویم من مایه و مغز
وُ پس گفتم زمین ماست ایران
که بیش از مردمانش پارسیدان
وُگر تازی کنم نیکو نباشد
که هر کس را از او نیرو نباشد
دری گویمش تا هرکس بداند
وُ هرکس برزبانش بر براند
Translation: When I decided to compose works, many thoughts ran through my mind. I wanted everyone to understand the knowledge I am writing. I was undecided to write in Persian or Arabic Then I told myself that our country is Iran, and the majority of its people speak Persian, thus if I write in Arabic it is not right, because not every may benefit from that language, Thus I will compose it in Dari (Persian) So that people can understand it and recite it
The name was also used for inhabitants. For example Safi al-Din al-Urmawi, a famous Iranian musician is referred to by Qutb al-Din Shirazi ((1236–1311)) as the wise sage of Iran. According to the Encyclopedia of Islam on Safi al-Din al-Urmawi:
|“||The sources are silent about the ethnic origin of his family. He may have been of Persian People descent (Qutb al-Din al-Shirazi calls him afdal-i Īrān (A sage of Iran))||”|
Modern usage 
During the Safavid era, most of the territory of the Sassanid empire regained its political unity, and Safavid kings were assuming the title of "Šāhanšāh-e Irān" (Iran's king of kings). An example is Mofid Bafqi (d. 1679) who makes numerous references to Iran, describing its border and nostalgia of Iranians that had migrated to India in that era. Even Ottoman sultans, when addressing the Āq Quyunlu and Safavid kings, used such titles as the “king of Iranian lands” or the “sultan of the lands of Iran” or “the king of kings of Iran, the lord of the Persians”. This title, as well as the title of "Šāh-e Irān", was later used by Nader Shah Afshar and Qajar and Pahlavi kings. Since 1935, the name "Iran" also has replaced other names of Iran in the western world. Jean Chardin who travelled to Persian between 1673 to 1677 has observed that both Iran and Fars were used concurrently:
|“||The Persians, in naming their Country, make use of one Word, which they indifferently pronounce Iroun, and Iran; ...Even to this very Day, the King of Persia is call'd Padcha Iran, and the Great Vizier, Iran Medary, the Pole of Persia. This is the Modern Appelation, the most in Use in that Country. That which they frequently make use of in the Second Place, is the Term Fars, which is the particular Name of the Province; the Metropolis of which, in ancient Days, was Persepolis, and which gave its Name to All Province of the Kingdom, and the Seat of its Monarch. This Word Fars, to signify Persia, is very ancient; and the Persians still call the Old Language of their Country, which was in use before the Days of Mahometanism, Saboun Fours, the Tonge of Persia"||”|
Since the Iranian Revolution of 1979, the official name of the country is "Islamic Republic of Iran."
See also 
- In the Avesta the airiia- are members of the ethnic group of the Avesta-reciters themselves, in contradistinction to the anairiia-, the "non-Aryas". The word also appears four times in Old Persian: One is in the Behistun inscription, where ariya- is the name of a language or script (DB 4.89). The other three instances occur in Darius I's inscription at Naqsh-e Rustam (DNa 14-15), in Darius I's inscription at Susa (DSe 13-14), and in the inscription of Xerxes I at Persepolis (XPh 12-13). In these, the two Achaemenid dynasts describe themselves as pārsa pārsahyā puça ariya ariyaciça "a Persian, son of a Persian, an Ariya, of Ariya origin." "The phrase with ciça, “origin, descendance,” assures that it [i.e. ariya] is an ethnic name wider in meaning than pārsa and not a simple adjectival epithet."
- Most notably the Šahrestānīhā ī Ērānšahr, which is a description of various provincial capitals (šahrestānīhā) of the ērānšahr. Its idea of ērānšahr includes Africa and Arabia.
- MacKenzie, David Niel (1998). "Ērān, Ērānšahr". Encyclopedia Iranica 8. Costa Mesa: Mazda.. Accessed online versuib on April 12, 2010.
- Schmitt, Rüdiger (1987). "Aryans". Encyclopedia Iranica 2. New York: Routledge & Kegan Paul. pp. 684–687.
- Bailey, Harold Walter (1987). "Arya". Encyclopedia Iranica 2. New York: Routledge & Kegan Paul. pp. 681–683.
- Gignoux, Phillipe (1987). "Anērān". Encyclopedia Iranica 2. New York: Routledge & Kegan Paul. pp. 30–31.
- Markwart, J.; Messina, G. (1931). A catalogue of the provincial capitals of Eranshahr: Pahlavi text, version and commentary. Rome: Pontificio istituto biblico.
- Daryaee, Touraj (2002). Šahrestānīhā ī Ērānšahr. A Middle Persian Text on Late Antique Geography, Epic, and History. With English and Persian Translations, and Commentary. Mazda Publishers. (Related work)
- Hamilton, H. C. & W. Falconer (1903). The Geography of Strabo. Literally translated, with notes 3. London: George Bell & Sons. p. 125. (Geography 15.2)
- Hamza Isfahani, Tarikh Payaambaraan o Shaahaan, translated by Jaf'ar Shu'ar,Tehran: Intishaaraat Amir Kabir, 1988.
- Maysarī, Ḥakīm, b. 935. ,Dānishnāmah dar ʻilm-i pizishkī : kuhantarīn majmūʻah-ʾi ṭibbī bih shiʻr-i Fārsī / az Ḥakīm Maysarī ; bi-ihtimām-i Barāt Zanjānī, Tihrān : Muʾassasah-ʾi Muṭālaʻāt-i Islāmī-i Dānishgāh-i Makʹgīl bā hamkārī-i Dānishgāh-i Tihrān, 1987.
- Neubauer, E. "Safī al- Dīn al- Urmawī." Encyclopaedia of Islam. Edited by: P. Bearman , Th. Bianquis , C.E. Bosworth , E. van Donzel and W.P. Heinrichs. Brill, 2007. Brill Online. <http://www.encislam.brill.nl/subscriber/entry?entry=islam_SIM-6447>
- IRANIAN IDENTITY - iii. MEDIEVAL ISLAMIC PERIOD, Encyclopedia Iranica
- (John Chardin, Sir John Chardin Travels in Persia, 1673-1677 (New York: Dover, 1988- pp 126). Also available in google books (page 126:  (John Chardin, Sir John Chardin Travels in Persia, 1673-1677 (New York: Dover, 1988) Note " Padcha Iran" is French version of Padishah-e Iran and Iran Medary is the French pronunciation of Iran-Madaar (Axis of Iran).
- IRANIAN IDENTITY - ii. PRE-ISLAMIC PERIOD, Encyclopædia Iranica