The first attestation of the term is in the Latin charter of duke Trpimir from 852 AD, whose original has been lost. A copy has been preserved in a 1568 transcript; Lujo Margetić has proposed in 2002 that the document is in fact of legislative character, dating to AD 840. In it is mentioned:
Dux Chroatorum iuvatus munere divino […] Regnum Chroatorum
The earliest written monument in Croatian language, containing the ethnonym *xъrvatъ (khŭrvatŭ, IPAxŭrva:tŭ) is the Baška tablet from 1100 AD, which reads: zvъnъmirъ kralъ xrъvatъskъ ("Zvonimir, king of Croats").
The exact origin and meaning of the ethnonym Hrvat (Proto-Slavic *Xъrvátъ) is not known and still subject to scientific dispute. It is believed, that the word might not be of native Slavic lexical stock, but a borrowing. Common theories from the 20th century derive it from an Iranian origin, the root word being a third-century Scytho-Sarmatian form attested in the Tanais Tablets as Χοροάθος (Khoroáthos, alternate forms comprise Khoróatos and Khoroúathos).
This form was used to substantiate the derivation of Proto-Slavic *xъrvatъ from the Old Persian xaraxwat-, attested by the Old Iranian toponym Harahvait-, the native name of Arachosia. "Arachosia" is the Latinized form of Ancient Greek Ἀραχωσία (Arachosíā); in Old Persian inscriptions, the region is referred to as Harahuvatiš (). In Indo-Iranian it actually means "one that pours into ponds", which derives from the name of the mythological Sarasvati River. However, although the somewhat suggestive similarity, the connection to the name of Arachosia is etymologically incorrect.
The first etymological thesis about the name of the Croats stems from Constantine Porphyrogennetos (tenth century), who connected the different names of the Croats, Βελοχρωβάτοι and Χρωβάτοι (Belokhrobatoi and Khrobatoi), with the Greek word χώρα (khṓra, "land"): "Croats in Slavic language means those who have many lands". In the 13th century, Thomas the Archdeacon considered that it was connected with the name of inhabitants of the Krk isle, which he gave as Curetes, Curibantes. In the 17th century, Juraj Ratkaj found a reflexion of the verb hrvati (se) "to wrestle" in the name.
In the 19th century, many different propositions were given, in order to interpret the Croatian ethnonym:
A. Bruckner linked it with Slovak charbati se "to oppose" or via skъrv-/xъrv- to the Lithuanian šárvas "armor";
K. Oštir considered valid the connection with an unspecified Thraco-Illyrian word xъrvata- "hill";
Max Vasmer first considered it as a loanword from Old-Iranian, haurvatā "shepherd" (Avestan haurvaiti means "pasturage"), later also from Old-Iranian hu-urvatha- "friend" (also accepted by N. Zupanič).
Zupanič additionally proposed Lezgian origin from Xhurava (community) and plural suffix -th, meaning "municipalities, communities".
M. Budimir saw in the name a reflexion of Indo-European *skwos "gray, grayish", which in Lithuanian gave širvas;
V. Miller saw in the Croatian name the Iranian hvar- "sun" and va- "bed", while P. Tedesco had a similar interpretation from Iranian huravant "sunny";
O. Kronsteiner derived it from Tatar-Bashkir *chr "free" and *vata "to fight, to wage war".
From the Iranian theses the most accepted is the derivation by Oleg Trubachyov from *xar-va(n)t (feminine, rich in women, ruled by women), which derives from the etymology of Sarmatians name, the Indo-Aryan*sar-ma(n)t "feminine", in both Indo-Iranian adjective suffix -ma(n)t/wa(n)t, and Indo-Aryan and the Indo-Iranian *sar- "woman", which in Iranian gives *har-. According to Radoslav Katičić this thesis doesn't entirely abide with the Croatian ethnonym, as the original form was Hrъvate not Hъrvate, and the vowel "a" in the desired Iranian harvat- is short, while in Slavic Hrъvate it is long. Katičić concluded that of all the etymological considerations the Iranian is at least unlikely.
Thus in the Duchy of Carinthia one can find Hrvatski kotar and Chrowat along upper Mura; in Middle Ages the following place names have been recorded: Krobathen, Krottendorf, Krautkogel;Kraut (before Chrowat and Croat) near Spittal. In the Duchy of Styria there are toponyms such as Chraberstorf and Krawerspach near Murau, Chrawat near Laas in Judendorf, Chrowat, Kchrawathof and Krawabten near Leoben. Along middle Mura Krawerseck, Krowot near Weiz, Krobothen near Stainz and Krobathen near Straganz.
In Slovenia there are Hrovate and Hrovača; in Germany along Saale river there were Chruuati near Halle) in 901 AD, Chruuati in 981 AD,Chruazis in 1012 AD,Churbate in 1055 AD,Grawat in 1086 AD,Curewate (now Korbetha), Großkorbetha (Curuvadi and Curuuuati 881-899 AD) and Kleinkorbetha, and Korbetha west of Leipzig; In Moravia are Charwath or Charvaty near Olomouc, in Slovakia are Chorvaty and Chrovátice near Varadka. The Charvatynia near Kashubians in district Neustadt is debatable.
^"The same region appears in the AvestanVidēvdāt (1.12) under the indigenous dialect form Haraxvaitī- (whose -axva- is typical non-Avestan)."Schmitt, Rüdiger (1987), "Arachosia", Encyclopædia Iranica2, New York: Routledge & Kegan Paul, pp. 246–247
Marčinko, Mato (2000), "Tragovi i podrijetlo imena Hrvat" [Traces and the origin of Croatian name], Indoiransko podrijetlo Hrvata [Indo-Iranian origin of Croats] (in Croatian), Naklada Jurčić, ISBN953-6462-33-8
Gračanin, Hrvoje (2006), Kratka povijest Hrvatske za mlade I. - od starog vijeka do kraja 18. stoljeća [Short history of Croatia for youth I. - from the old age till the end of 18th century] (in Croatian), Zagreb: Sysprint, ISBN953-232-111-X