Short answer
Touching pork is not a sin in itself, but pork is impure, so you must wash whatever touched it before praying. Cooking or serving pork is not permitted in the Hanafi fatwa position, even for non-Muslim family or customers. Gloves keep your hands clean but do not change the ruling on cooking it.
The pig is impure in itself (najis al-ayn). Contact with wet pork, or with pork while your hand is wet, makes the hand impure and it must be washed. A Muslim may not prepare, cook or serve pork, and should not use or sell anything made from the pig.
The four schools agree on this.
Explanation
Many Muslims, especially converts and those with non-Muslim family, ask whether they can handle pork at all. Separate the questions:
- Touching: not sinful. If either the pork or your hand is wet, wash the place that touched it before you pray. A sealed package can be touched without any washing.
- Tasting or eating: haram (see what happens if you eat pork).
- Cooking and serving: not permitted in the Hanafi fatwa position, at home or at work.
Why not cook it for others? The pig is forbidden in a way that goes beyond eating: the Prophet ﷺ forbade even trading in it. Cooking pork means handling impurity by choice and preparing what Allah forbade, which is helping in what is wrong. The published ruling on working in restaurants follows the same line. Wearing gloves keeps your hands pure but does not make the cooking permissible.
Living with non-Muslim family: a convert may live with parents who eat pork and is not responsible for what they eat. Keep your own pans and utensils, or wash shared ones well, and explain kindly that you cannot cook it. Many families accept this once they understand it is religious.
Pets: many Hanafi muftis advise against buying pork-based pet food, as benefiting from the pig is restricted; choose other flavours. Grocery work that only involves scanning sealed pork is lighter than cooking it. Ask a mufti about your situation if your job or home involves pork regularly.
Ask a mufti about your own case. This answer explains the general ruling. When the details of your situation matter, as they do here, ask a qualified mufti and give them the full facts. Where to ask a scholar.
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."
Calls pork impure, the basis for washing after contact.
Quran, Surah Al-Maaida 5:2
يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوا۟ لَا تُحِلُّوا۟ شَعَٰٓئِرَ ٱللَّهِ وَلَا ٱلشَّهْرَ ٱلْحَرَامَ وَلَا ٱلْهَدْىَ وَلَا ٱلْقَلَٰٓئِدَ وَلَآ ءَآمِّينَ ٱلْبَيْتَ ٱلْحَرَامَ يَبْتَغُونَ فَضْلًۭا مِّن رَّبِّهِمْ وَرِضْوَٰنًۭا ۚ وَإِذَا حَلَلْتُمْ فَٱصْطَادُوا۟ ۚ وَلَا يَجْرِمَنَّكُمْ شَنَـَٔانُ قَوْمٍ أَن صَدُّوكُمْ عَنِ ٱلْمَسْجِدِ ٱلْحَرَامِ أَن تَعْتَدُوا۟ ۘ وَتَعَاوَنُوا۟ عَلَى ٱلْبِرِّ وَٱلتَّقْوَىٰ ۖ وَلَا تَعَاوَنُوا۟ عَلَى ٱلْإِثْمِ وَٱلْعُدْوَٰنِ ۚ وَٱتَّقُوا۟ ٱللَّهَ ۖ إِنَّ ٱللَّهَ شَدِيدُ ٱلْعِقَابِ ﴿٢﴾
O you who have believed, do not violate the rites of Allah or [the sanctity of] the sacred month or [neglect the marking of] the sacrificial animals and garlanding [them] or [violate the safety of] those coming to the Sacred House seeking bounty from their Lord and [His] approval. But when you come out of ihram, then [you may] hunt. And do not let the hatred of a people for having obstructed you from al-Masjid al-Haram lead you to transgress. And cooperate in righteousness and piety, but do not cooperate in sin and aggression. And fear Allah; indeed, Allah is severe in penalty.
The basis for not preparing forbidden food for others.
Sahih al-Bukhari 2236
Sahih... إن الله ورسوله حرم بيع الخمر والميتة والخنزير والأصنام ...
"Allah and His Messenger have forbidden the sale of wine, carrion, pigs and idols."
The prohibition of the pig extends beyond eating.
Where the ruling is recorded
- al-Hidaya, Kitab al-Taharah, chapter on impurities. The pig is impure in itself, and how impurity is washed.
- Radd al-Muhtar (Ibn Abidin), Kitab al-Hazr wa al-Ibaha. Using and benefiting from the pig is not permitted.
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.