Ihsan means doing what is good or beautiful, and in religious usage it names excellence in worship. Its defining text is the Hadith of Gabriel, in which a stranger arrives before the Prophet's Companions and questions him: told first of islam, the outward acts, and then of iman, what is believed, he asks about ihsan and receives the answer, "that you worship God as though you see Him; for if you do not see Him, He sees you." He then departs, and the Prophet identifies him as Gabriel, come to teach them their religion.
That three-part structure became the tradition's standard self-description, and the disciplines were mapped onto it: islam as outward practice, the province of fiqh; iman as creed, the province of kalam; ihsan as the inward quality, the province of tasawwuf. Sufi writers have appealed to this framing to locate their concerns at the centre of Islam rather than at its edge, and it is one of the most frequently deployed arguments in defence of Sufism's legitimacy. Critics who regard the organised orders as innovation generally accept ihsan itself as a Qur'anic virtue while denying that the hadith licenses the orders, their initiations or their hierarchies.
The Qur'an uses the root broadly and not only of worship. God "loves those who do good" (2:195, 3:134), and 16:90 pairs justice with ihsan as what God commands, a pairing the commentators read as the difference between giving what is owed and giving beyond it. Ethical writing in the tradition accordingly treats ihsan as covering both the quality of one's attention to God and one's generosity to other people, including, in a widely cited hadith on slaughter, the obligation of kindness to animals.