الجواب باسم ملهم الصدق والصواب
Yes, clothes washed in a washing machine become pure. Washing by hand is not a condition for purification. When the clothes are washed in the machine in the normal way with clean water, the water is drained out, the clothes are spun, and the impurity is removed, the clothes are considered pure.
There is no problem in washing pure and impure clothes together in the machine; all the clothes will be pure once the wash is complete. The machine itself does not need to be purified separately.
If there is visible impurity on the clothes, such as blood or excrement, it is better to remove it before putting them in the machine. After washing, there is no need to wash again and again because of baseless doubt.
Evidence
Allah the Exalted says:
إِنَّ اللَّهَ يُحِبُّ التَّوَّابِينَ وَيُحِبُّ الْمُتَطَهِّرِينَ
Meaning: “Indeed, Allah loves those who repent and loves those who purify themselves.” (Surah Al-Baqarah, 2:222)
It is stated in Ad-Durr Al-Mukhtar:
ويطهر غيرها أي غير مرئية بغلبة ظن غاسل طهارة محلها بلا عدد به يفتى.
Meaning: “Invisible impurity is purified when the person washing has a strong conviction that the place has become pure; no specific number of washes is required. The fatwa is based on this.”
(Ad-Durr Al-Mukhtar with Radd Al-Muhtar, vol. 1, p. 539, Kitab At-Taharah, Bab Al-Anjas, Zakariya edition)
Summary
Clothes washed in a washing machine become pure. Washing by hand is not necessary, and one should not entertain baseless doubts about this.
والله أعلم بالصواب
And Allah knows best.
