A:
Masturbation during Ramadan and at other times is Haram. It is unlawful to do so based on the Saying of Allah:
And those who guard their chastity (i.e. private parts from illegal sexual acts).
Except from their wives or the (women slaves) whom their right hands possess - for (then) they are not blameworthy.
But whosoever seeks beyond that, then it is those who are trespassers.
Anyone who practices it during the daytime in Ramadan while fasting has to repent to Allah and make up for the Sawm of the respective day. However, it does not necessitate Kaffarah because it is prescribed specifically in the case of sexual intercourse. (Part No. 10; Page No. 257) May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.