بسم الله الرحمن الرحيم
(Fatwa: 1149/1153/M=9/1434)
Yes, masturbation is a grave sin. You should seek forgiveness from Allah for it weeping and saying: O Allah forgive this sin. You must avoid it in future. It is far better if you offer two rakahs salah al-taubah and seek forgiveness from Allah. Also, if possible give something in charity. Your fast broke due to it; hence you should make qaza of one fast after Ramadan.
Allah knows Best!
Darul Ifta,
Darul Uloom Deoband
