In the name of Allāh, the Most Gracious, the Most Merciful. And may His perpetual peace and blessings be upon our Beloved, our Liege Muḥammad, the Chosen One.
Note: For passages and quotes from Arabic legal texts and references, refer to endnotes. References to endnotes are made by Roman numerals (e.g. i, ii, iii, etc.), while references to footnotes are made by Arabic numerals (e.g. 1, 2, 3, etc.).
The doctrine and philosophy of Islam in structuring its legal edifice is inclusive of an adherent’s lifestyle, including his/her beautification, attire, and ornaments; rather, it is an elaborate area exhaustively discussed in the ornate chapters of the Islamic legal corpus and the Canons of Prophetic Narrations (ḥadīth). As jurists (fuqahā) have meticulously extrapolated derivatives and subsidiaries (furūʿ), they have included in their works discussions concerning the permissibility of dyeing one’s hair.
Dyeing of the hair was a practice adopted by the beloved Apostle of Allāh (peace and blessings be upon him) albeit he did not have many white strands neither on his scalp nor his beard. This is reported by the doyen of ḥadīth Muḥammad b. Ismāʿīl al-Bukhārī in his Ṣaḥīh via the Companion Anas b. Mālik (may Allāh be pleased with him), who upon being inquired by Muḥammad b. Sīrīn said: [i] “He did not have but a few grey hairs.” Similarly, as Qatādah asked him concerning whether the Prophet (peace be upon him) would dye his hair or not, he replied:[ii] “No, rather it was but a few strands in his ear locks.”
Hence, in the Ḥanafī legal school, dyeing one’s hair is recommended (mustaḥabb), but not a Prophetic Tradition (sunnah), because a sunnah is an action performed by the Apostle of Allāh (peace be upon him) with continuity although it may have been omitted occasionally. This is elucidated by Ibn ʿĀbidīn al-Shāmī in his celebrated gloss (ḥāshiyah) on al-Ḥaskafī’s Al-Durr al-mukhtār. It was also a practice of many of the Companions (ṣaḥābah) of the Apostle of Allāh (peace be upon him). Albeit there is an apparent contradiction in Prophetic Narrations (aḥādīth) concerning whether the Messenger (peace be upon him) dyed his hair or not, experts and exegetes of the ḥadīth canon such as Ibrāhīm b. Muḥammad al-Bājūrī have reconciled them. From the affirmative narrations, inter alia, is the report from the Successor (tābiʿī) ʿUthmān b. Mauhib:[iii] “[The Companion] Abū Hurayrah was inquired: ‘Did the Messenger of Allāh dye [his hair]? He said: ‘Yes.’” 
Al-Bājūrī, in his commentary of the Shamāʾil titled Al-Mawāhib al-ladunniyyah, has exhaustively discussed the textual evidences (nuṣūṣ) positing the dyeing of the Prophet’s hair; his discussion is inclusive of Prophetic Narrations from al-Bukhārī’s Al-Jāmiʿ al-ṣaḥīḥ and Muslim’s Al-Musnad al-ṣaḥīḥ. As for opposing reports negating the dyeing of the Messenger’s hair, there is, inter alia, the aforementioned report from the Companion Anas b. Mālik. Al-Bājūrī reconciles these seemingly conflicting narrations, elucidating that the Prophet (peace be upon him) would dye his hair at times, while at other times, he would not. The former narrations are reported by those who saw him in the latter times, and vice versa. It is because of this intermittent practice devoid of continuity that it is a recommend (mustaḥabb) act and not a sunnah.
Albeit the dyeing of Prophetic hair is contentious, he (peace be upon him) nonetheless recommended and preferred that adherents apply dye to their hair and beard, as it is a distinctive feature of Muslims. In a report transmitted by Imām al-Bukhārī via the Companion Abū Hurayrah from the Apostle of Allāh (peace be upon him), he stated:[iv] “The Christians and Jews do not dye [their hair and beard], thus oppose them (as a representation of your unique identity).”  The philosophy behind it is something relatable to any prestigious societal faction, as military personnel, paramedics, police officers, etc. wear distinctive clothes to represent their unique identity amidst society. Analogous to the aforementioned professionals, the Messenger (peace and blessings be upon him) left adherents as carriers of a duty who have a unique identity. His exhortation for dyeing is furthermore depicted in a narration transmitted by al-Nasāʾī via the Companion Abū Dharr (may Allāh be pleased with him) from the Messenger (peace be upon him), he said:[v] “The best of that which you can dye with is henna and katm.” 
There is no specific restriction in the Islamic legal canon concerning specifics of dyeing one’s hair (i.e. color, portions, etc.), with the exception of pure black color. The Prophet (peace be upon him), while suggesting that Abū Quḥāfah, the father of Abū Bakr (may Allāh be pleased with them both), should dye his white hair and beard when he was presented at the time of the conquest of Mecca, he prohibited dyeing in pure black. In the report narrated by Imām Muslim, he said:[vi] “Alter this (i.e. his white hair and beard) with something, and abstain from black dye.” Or as Imām Ahmad b. Hambal reports from him in his voluminous ḥadīth compilation, Al-Musnad:[vii] “Alter them (i.e. the colour of his hair and beard) and keep him away from [pure] black.”  Similarly, in a narration transmitted by Abū Dāwūd, the Messenger (peace be upon him) asserted:[viii] “There will be a people in later times who will dye in black like the crops of doves; they will not smell the fragrance of Paradise.” 
In regard of these narrations, jurists (fuqahā) have vehemently disliked the use of pure black dye. Nonetheless, if a soldier or warrior employs pure black dye for the purpose of instilling awe in the opposition and to break their morale, it is permissible in the view of all jurists. This is reflected in the writings of Al-Sarakhsī[ix], Ibn ʿĀbidīn al-Shāmī[x], the assembly of Indian jurists under Nizām al-Dīn al-Balkhī[xi], and many other jurists. However, if one applies pure black dye for deceptive purpose as to create ambiguity pertaining their age, it is impermissible. As for one who applies black dye for the purpose of beautification, there is a difference of opinion.
Hence, in the Hanafite school of legal thought itself, the application of black dye for mere beautifying purposes is a matter of contention. The predominant opinion amongst the Ḥanafī jurists is that it is disliked (makrūh), while some have permitted it on the basis of the statement reported in Al-Siyar al-kabīr (as asserted by Burhān al-Bukhārī) from Imām Abū Yūsuf (one of the prominent disciples of Imām Abū Ḥanīfah)[xii]: “Just as it gratifies me that she (i.e. my wife) beautifies herself for me, it likewise enchants her that I beautify myself for her.”
While the earlier al-Sarakhsī posits that the correct stance is the latter one, the likes of Burhān al-Dīn al-Bukhārī and Ibn ʿĀbidīn al-Shāmī assert that the majority of scholars have preferred the former opinion. Al-Sarakhsī’s postulation seems to be weightier in an evidentiary analysis for the subsequent reasons:
- It was the practice of multiple Companions (ṣaḥābah) and Successors (tābiʿūn);
- ʿUmar b. al-Khaṭṭāb, he would say “It is calming for the wife and instills awe in the enemy.”
- ʿUthmān b. ʿAffān
- ʿUqbah b. ʿĀmir
- Ḥasan b. ʿAlī
- Ḥusayn b. ʿAlī
- Ibn Shihāb al-Zuhrī
- ʿAlī b. ʿAbdillāh b. ʿAbbās
- ʿUrwah b. al-Zubayr
- Muḥammad b. Sīrīn
- Al-Sarakhsī is one of the earliest Ḥanafī juritsts and he has preferred this juristic stance. According to the juristic typology (ṭabaqāt al-fuqahā) formulated by Ibn Kamāl Pāshā, al-Sarakhsī is a jurist of the third degree, who are those that are capable of juristic reasoning (ijtihād) and extrapolate novel cases (masāʾil) that have not been discussed by the inaugurator(s) of the legal school.
Hence, blackening one’s hair with dye for the purpose of beautifying oneself for one’s spouse is deemed permissible.
As the individual’s appearance and its maintenance are matters relevant in the scope of sharīʿah, it is necessary for one to acquaint themselves with the lawful and unlawful regarding one’s appearance, thus embodying the philosophy and ideology of Islam in their walk, talk, and demeanor.
 Al-Bukhārī, Muḥammad b. Ismāʿīl, Al-Jāmiʿ al-ṣaḥīh, Ḥadīth 5894.
 Ibid., Ḥadīth 3550.
 Al-Shāmī, Muḥammad Amīn b. ʿĀbidīn, Radd al-muḥtārr ʿalā al-durr al-mukhtār, (Beirut: Dār al-Fikr, 1992), 1:124.
 Al-Tirmidhī, Muḥammad b. ʿĪsā, Shamāʿil al-Tirmidhī, ed. Muḥammad Zakariyyā al-Kandhlawī, (Karachi: Al-Bushra Publishers, 2009), pp. 60.
 Al-Tirmidhī, Al-Bājūrī, Al-Shamāʾil al-Muḥammadiyyah wa maʿahū al-mawāhib al-ladunniyyah, ed. Muḥammad ʿAwwāmah, (Medina: Dār al-Minhāj, 2001), pp. 134.
 Al-Bukhārī, Muḥammad b. Ismāʿīl, Ṣaḥīḥ al-Bukhārī, ed. Muḥammad Zuhair b. al-Nāṣir, (Cairo: Dār Ṭūq al-Najāh, 2001), 7:161.
 Al-Nasāʾī, Aḥmad b. Shuʿayb, Sunan al-Nasāʾī al-sughrā, ed. ʿAbd al-Fattāḥ Abū Ghuddah, (Aleppo: Maktab al-Maṭbūʿāt al-Islāmiyyah, 1986), 8:139.
 Al-Nīsāpūrī, Muslim b. al-Ḥajjāj, Ṣaḥīḥ Muslim, ed. Fuʾād ʿAbd al-Bāqī, (Beirut: Dār Iḥyā al-Turāth al-ʿArabī, n.a.), 3:1663.
 Ibn Ḥambal, Aḥmad, Al-Musnad, ed. Shuʿayb al-Arnaut, (Beirut: Muʾassasah al-Risālah, 2001), 20:82.
 Al-Sijistānī, Sulaimān b. al-Ashʿath, Sunan Abī Dāwūd, ed. Muḥammad Muḥī al-Dīn ʿAbd al-Ḥamīd, (Beirut: Al-Maktabah al-ʿAṣriyyah, n.a.) 4:87.
 See al-Sarakhsī, Muḥammad b. Aḥmad, Al-Mabsūṭ, (Beirut: Dār al-Maʿrifah, 1993), 10:199, al-Bukhārī, Burhān al-Dīn, Al-Muḥīṭ al-burhānī fi’l fiqh al-Nuʿmānī, ed. ʿAbd al-Karīm Sāmī al-Jundī, (Beirut: Dār al-Kutub al-ʿIlmiyyah), 5:377, al-Ḥaṣkafī and Al-Shāmī, Radd al-muḥtārr ʿalā al-durr al-mukhtār, (Beirut: Dār al-Fikr, 1992), 6:756 and al-Dihlawī, ʿAbd al-Raḥīm et al., Al-Fatāwā al-Hindiyyah, (Damascus: Dār al-Fikr, 1893), 5:359.
 See al-ʿAynī, Badr al-Dīn, ʿUmdat al-qārī sharḥ ṣaḥīḥ al-Bukhārī, (Beirut: Dār Iḥyā al-Turāth al-ʿArabī, n.a.), 22:51.
[i] عن أنس بن مالك رضي الله عنه قال: لم يبلغ الشيب إلا قليلا رواه البخاري عن ابن سيرين عنه
[ii] وعنه قال: لا إنما كان شيء في صدغيه رواه البخاري عن قتادة عنه
[iii] عن عثمان بن موهب: سئل أبو هريرة: هل خضب رسول الله؟ قال: نعم رواه الترمذي
[iv] قال الحبيب صلى الله عليه وسلم: إن اليهود والنصارى لا يصبغون، فخالفوهم رواه البخاري عن أبي هريرة رضي الله عنه
[v] وقال صلى الله عليه وسلم: إن أحسن ما غيرتم به الشيب الحناء والكتم رواه النسائي عن أبي ذر رضي الله عنه
[vi] وقال صلى الله عليه وسلم: غيّروا هذا بشيء، واجتنبوا السواد رواه مسلم
[vii] وقال صلى الله عليه وسلم: غيّروهما وجنّبوه السواد
[viii] وقال صلى الله عليه وسلم: يكون قوم يخضبون في آخر الزمان بالسواد، كحواصل الحمام لا يريحون رائحة الجنة
[ix] (قال السرخسي في مبسوطه: ولا خلاف أنه لا بأس للغازي أن يختضب في دار الحرب ليكون أهيب في عين قرنه (المبسوط 10/199 – دار المعرفة
[x] قال ابن عابدين أما الخضاب بالسواد للغزو، ليكون أهيب في عين العدو فهو محمود بالاتفاق (رد المحتار على الدر المختار 6/756 – دار الفكر)
[xi] قالوا في الفتاوى الهندية: وأما الخضاب بالسواد فمن فعل ذلك من الغزاة ليكون أهيب في عين العدو فهو محمود منه، اتفق عليه المشايخ رحمهم الله تعالى (الفتاوى الهندية 3/359 – دار الفكر)
[xii] قال أبو يوسف: كما يعجبني أن تتزين لي يعجبها أن أتزين لها. يرويه ذلك عنه السرخسي في مبسوطه (انظر المرجع السابق) وبرهان الدين البخاري في محيطه (المحيط البرهاني في الفقه النعماني 5/377 – دار الكتب العلمية)