From Badakhshan province in northern Afghanistan., Shahrani is ethnically Uzbek. Although he was one of the ideological figures behind the Afghan resistence against the Soviet invasion of Afghanistan, he was never involved in any sectarian, party and other ethnic conflicts in Afghanistan. For that he earned the nickname of Mr. Clean.
He studied at Kabul University, Al-Azhar University (Cairo) and George Washington University (USA).
Currently some of his other family members are teaching at academic institutions in the United States (such as Indiana University, Bloomington) and Great Britain.