His father, Husayn, was the mayor of Barsgan and related to the Karakhanid ruling dynasty. His mother was Bibi Rābiy'a al-Basrī. He studied Turkic dialects and wrote the first comprehensive dictionary of Turkic languages, the [[Dīwān ul-Lughat al-Turk]] (Arabic: Collection of Turkic words) in 1072. It was intended for use by the Caliphs of Baghdad, the new, Arabic allies of the Turks. Mahmud Kashgari's comprehensive dictionary contains specimens of old Turkic poetry in the typical form of quatrains (Persian/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.
Mahmud Kashgari died in 1102 at the age of 97 in upal, small city southwest of Kashgar, and was buried there. There is now a mausoleum erected on his gravesite (opened on May 26, 2006). He is remembered as a prominent Uyghur scholar.