His father, Hussayn, was the mayor of Barsgan, a town in the southeastern part of the lake of Issyk-Kul (nowadays village of Barskoon in northern Kyrgyzstan's Issyk-Kul Region) and related to the ruling dynasty of Kara-Khanid Khanate.
Al-Kashgari studied the Turkic languages of his time and in Baghdad he composed the first comprehensive dictionary of Turkic languages, the Dīwān Lughāt al-Turk (Arabic: "Compendium of the languages of the Turks") in 1072-74. It was intended for use by the Abbasid Caliphate, the new, Arab allies of the Turks. Mahmud Kashgari's comprehensive dictionary, later edited by the Turkish historian, Ali Amiri, contains specimens of old Turkic poetry in the typical form of quatrains (Persio-Arabic رباعیات rubā'iyāt; Turkish: dörtlük), representing all the principal genres: epic, pastoral, didactic, lyric, and elegiac. His book also included the first known map of the areas inhabited by Turkic peoples. This map is housed at the National Library in Istanbul.
He advocated monolingualism and the linguistic purism of the Turkic languages, and held a belief in the superiority of nomadic people (the Turkic tribes had traditionally been nomads) over urban populations. Most of his Turkic-speaking contemporaries were bilingual in Tajik (a Persian language), which was then the urban and literary language of Central Asia.
The most elegant of the dialects belongs to those who know only one language, who do not mix with Persians and who do not customarily settle in other lands. Those who have two languages and who mix with the populace of the cities have a certain slurring in their utterances.
One of al-Kashgari's most historically significant poems, tells of the Turko-Islamic conquest of the last of the renowned Central Asian Buddhist kingdoms, the Kingdom of Khotan of the Iranian Sakas:
The Turkic Qarakhanid and Uyghur Qocho Kingdoms were both states founded by invaders while the native populations of the region were Iranic and Tocharian peoples along with some Chinese in Qocho and Indians, who married and mixed with the Turkic invaders, and prominent Qarakhanid people such as Mahmud Kashghari hold a high position among modern Uyghurs.
The Muslim Kara-Khanid Turks performed Jihad against Buddhist Uyghur Turks during the Islamicisation and Turkicisation of Xinjiang.
The non-Muslim Turks worship of Tengri was mocked and insulted by the Muslim Turk Mahmud al-Kashgari, who wrote a verse referring to them - The Infidels - May God destroy them!
Kashgari claimed that the Prophet assisted in a miraculous event where 700,000 Yabāqu "infidels" were defeated by 40,000 Muslims led by Arslān Tegīn claiming that fires shot sparks from gates located on a green mountain towards the Yabāqu. The Yabaqu were a Turkic people.
The Muslim Turk Mahmud Kashgari insulted the Uyghur Buddhists as "Uighur dogs" and called them "Tats", which referred to the "Uighur infidels" according to the Tuxsi and Taghma, while other Turks called Persians "tat". While Kashgari displayed a different attitude towards the Turks diviners beliefs and "national customs", he expressed towards Buddhism a hatred in his Diwan where he wrote the verse cycle on the war against Uighur Buddhists. Buddhist origin words like toyin (a cleric or priest) and Burxān or Furxan (meaning Buddha, acquiring the generic meaning of "idol" in the Turkic language of Kashgari) had negative connotations to Muslim Turks.
Kashghari viewed the least Persian mixed Turkic dialects as the "purest" and "the most elegant".
Muslim writers like Marwazī and Mahmud Kashghārī had more up to date information about China in their writings, Kashgari viewed Kashgar as part of China.
Ṣīn [i.e., China] is originally three fold; Upper, in the east which is called Tawjāch; middle which is Khitāy, lower which is Barkhān in the vicinity of Kashgar. But know Tawjāch is known as Maṣīn and Khitai as Ṣīn. China was called after the Toba rulers of the Northern Wei by the Turks, pronounced by them as Tamghāj, Tabghāj, Tafghāj or Tawjāch. India introduced the name Maha Chin (greater China) which caused the two different names for China in Persian as chīn and māchīn (چين ماچين) and Arabic ṣīn and māṣīn (صين ماصين), Southern China at Canton was known as Chin while Northern China's Changan was known as Machin, but the definition switched and the south was referred to as Machin and the north as Chin after the Tang dynasty, Tang China had controlled Kashgar since of the Tang's Anxi protectorate's "Four Garrisons" seats, Kashgar was among them, and this was what led writers like Kashghārī to place Kashgar within the definition of China, Ṣīn, whose emperor was titled as Tafghāj or Tamghāj, Yugur (yellow Uighurs or Western Yugur) and Khitai or Qitai were all classified as "China" by Marwazī while he wrote that Ṣīnwas bordered by placed SNQU and Maṣīn. Machin, Mahachin, Chin, and Sin were all names of China.
Muslim writers like Marwazī wrote that Transoxania was a former part of China, retaining the legacy of Tang Chinese rule over Transoxania in Muslim writings
In ancient times all the districts of Transoxania had belonged to the kingdom of China [Ṣīn], with the district of Samarqand as its centre. When Islam appeared and God delivered the said district to the Muslims, the Chinese migrated to their [original] centers, but there remained in Samarqand, as a vestige of them, the art of making paper of high quality. And when they migrated to Eastern parts their lands became disjoined and their provinces divided, and there was a king in China and a king in Qitai and a king in Yugur. Muslim writers viewed the Khitai, the Gansu Uighur Kingdom and Kashgar as all part of "China" culturally and geographically with the Muslim Central Asians retaining the legacy of Chinese rule in Central Asia by using titles such as "Khan of China" (تمغاج خان) (Tamghaj Khan or Tawgach) in Turkic and "the King of the East and China" (ملك المشرق (أو الشرق) والصين) (malik al-mashriq (or al-sharq) wa'l-ṣīn) in Arabic which were titles of the Muslim Qarakhanid rulers and their Qarluq ancestors.
Some researchers think that Mahmud al-Kashgari died in 1102 at the age of 97 in Upal, a small city southwest of Kashgar, and was buried there. There is now a mausoleum erected on his gravesite. But some modern authors reject this assertion, saying that the date of his death is just unknown.
Some claim Mahmad Kashghari was Hazrat Mullam.
He is claimed by Uyghur, Kyrgyz, and Uzbek nationalists as part of their respective ethnic groups.
An oriental study university, situated in the capital city of Bishkek in post-Soviet Kyrgyzstan, was named after Makhmud Kashghari, in the 1990s.
UNESCO declared 2008 the Year of Mahmud al-Kashgari.