Short answer
No. In the Hanafi school the pig is impure in its essence (najis al-ayn), and keeping, buying or selling one is haram. The four schools agree that Muslims may not keep pigs. A guinea pig is not a pig at all; it is a rodent, and keeping one as a pet is fine.
The pig is najis al-ayn. Keeping it, raising it, buying and selling it are haram. Touching a dry pig does not make you impure, but contact with its wetness or saliva requires washing.
Other madhhabs
- Maliki
- Every living animal, including the pig, is pure while alive, so touching one does not make you impure. Keeping and selling pigs is still forbidden.
Explanation
Allah says of pork that it is impure (rijs). The Prophet ﷺ said that Allah and His Messenger have forbidden the sale of wine, dead animals, pigs and idols. So the pig is in a category of its own: it is not only unlawful to eat, but trading in it is forbidden too. The Hanafi scholars call it najis al-ayn, impure in its very essence, unlike a dog, whose body the Hanafis do not count as impure in itself.
Keeping a pig as a pet means feeding it, housing it, touching it all the time and often buying it, so the Hanafi school, with the other schools, rules it haram. Mini pigs and micro pigs take the same ruling: they are pigs.
Common questions:
- Guinea pigs: despite the name, they are rodents, not pigs. Keeping one is permitted like a hamster or rabbit.
- Touching a pig on a farm visit: if the pig and your hand are dry, you are not impure; if wet, wash the area before praying.
- Working on a pig farm or at a petting zoo: handling pigs as a job raises the question of earning from pigs. Ask a scholar.
- Converts with a pet pig: find it a good home with a non-Muslim family or a sanctuary, rather than abandoning it.
- Being kind to pigs: Islam forbids cruelty to every animal, pigs included.
For other pets, see can Muslims have cats and other pets. For why pork is forbidden, see why Muslims do not eat pork.
The evidence
Quran, Surah Al-An'aam 6:145
قُل لَّآ أَجِدُ فِى مَآ أُوحِىَ إِلَىَّ مُحَرَّمًا عَلَىٰ طَاعِمٍۢ يَطْعَمُهُۥٓ إِلَّآ أَن يَكُونَ مَيْتَةً أَوْ دَمًۭا مَّسْفُوحًا أَوْ لَحْمَ خِنزِيرٍۢ فَإِنَّهُۥ رِجْسٌ أَوْ فِسْقًا أُهِلَّ لِغَيْرِ ٱللَّهِ بِهِۦ ۚ فَمَنِ ٱضْطُرَّ غَيْرَ بَاغٍۢ وَلَا عَادٍۢ فَإِنَّ رَبَّكَ غَفُورٌۭ رَّحِيمٌۭ ﴿١٤٥﴾
Say, "I do not find within that which was revealed to me [anything] forbidden to one who would eat it unless it be a dead animal or blood spilled out or the flesh of swine - for indeed, it is impure - or it be [that slaughtered in] disobedience, dedicated to other than Allah. But whoever is forced [by necessity], neither desiring [it] nor transgressing [its limit], then indeed, your Lord is Forgiving and Merciful."
The pig is described as impure.
Sahih al-Bukhari 2236
Sahih... إن الله ورسوله حرم بيع الخمر والميتة والخنزير والأصنام ...
"Allah and His Messenger have forbidden the sale of wine, dead animals, pigs and idols."
Buying and selling pigs is forbidden.
Where the ruling is recorded
- al-Hidaya, Kitab al-Taharah, chapter on water and leftover water (su'r). The pig is impure in its essence, and its leftover water is impure.
- al-Hidaya, Kitab al-Buyu', chapter on invalid sales. Selling a pig is invalid, as it has no lawful value.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.