Yes, and it's one of the most meaningful ways to keep loving someone after they're gone. A companion named Sa'd ibn Ubadah once asked the Prophet ﷺ whether it would benefit his mother, who had died suddenly without leaving a will, if he gave charity on her behalf. The Prophet ﷺ answered simply, 'Yes.' So Sa'd dug a well and dedicated it to her. This reflects a broader teaching: when a person dies, their record of deeds is sealed except for three things that keep bringing them reward — ongoing charity (sadaqah jariyah), knowledge that continues to benefit others, and a righteous child who prays for them. Giving charity on behalf of the deceased — sponsoring a well, funding a Quran, supporting an orphan, contributing to a mosque — in their name channels good into a reward that keeps reaching them, by Allah's mercy, long after burial. It's a lovely, active way to grieve: instead of feeling helpless, you can keep doing something for the person you loved, and trust that Allah delivers it to them.
Q&A · Death & Afterlife
Can I give charity on behalf of someone who has died?
References
Sahih al-Bukhari 2756Sahih Muslim 1631
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.