For fasting to be obligatory, a person must be both legally competent (ʿāqil) and have reached puberty (bāligh). Accordingly, children, as well as those who have reached the age of puberty but lack mental capacity, are exempt from this obligation. The Messenger of Allah ﷺ explained this principle in the following statement:
“The pen (of accountability) has been lifted from three: from the child until they reach puberty, from the mentally incapacitated until they regain soundness of mind, and from the sleeping person until they awaken.”
(al-Bukhārī, Ḥudūd, 22; Abū Dāwūd, Ḥudūd, 17; al-Tirmidhī, Ḥudūd, 1)
Nevertheless, encouraging children to fast at an early age for the purpose of habituating them to acts of worship is a recommended and praiseworthy practice.
