Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:2:173

He has only forbidden to you dead animals, blood, the flesh of swine, and that which has been dedicated to other than Allah. But whoever is forced ˹by necessity˺, neither desiring ˹it˺ nor transgressing ˹its limit˺, there is no sin upon him. Indeed, Allah is Forgiving and Merciful.  

He has only forbidden you: carrion, that is, the consumption of it, since this is the subject of the general address here, and similarly ˹the consumption of˺ what follows, ˹all of˺ which is what has not been slaughtered in accordance with ˹prescriptions of˺ the Law; to this the Sunna adds ˹as also constituting carrion˺ what has been severed from a living creature. A special status is, however, accorded fish and locusts; blood, poured forth, as in ˹sūrat˺ al-An‘ām ˹see Q. 6:145˺, the flesh of swine, the meat is singled out for mention because that ˹part˺ is what people mostly seek, every other ˹part˺ being implied thereby; what has been hallowed to other than God, that is to say, what has been slaughtered in other than His Name (al-ihlāl is the raising of one’s voice, which they used to do when sacrificing for their gods). Yet whoever is constrained, forced by dire need to eat of the above-mentioned, not desiring, to rebel against Muslims, nor transgressing, committing aggression against them by waylaying them, no sin shall be on him, for eating it. God is Forgiving, to His friends, Merciful, to those who are obedient to Him, for He has granted them wide berth in this matter. The aggressor and the transgressor are excluded from this ˹dispensation˺, and to these two ˹categories˺ one should also add every person that sets out on a journey in disobedience, such as the fugitive or the excise collector, for whom it would be unlawful to eat any of the mentioned, unless they repent ˹of their disobedience˺; this is the opinion of al-Shāfi‘ī.
القرآن:٢:١٧٣

إِنَّمَا حَرَّمَ عَلَيْكُمُ الْمَيْتَةَ وَالدَّمَ وَلَحْمَ الْخِنْزِيرِ وَمَا أُهِلَّ بِهِ لِغَيْرِ اللَّهِ ۖ فَمَنِ اضْطُرَّ غَيْرَ بَاغٍ وَلَا عَادٍ فَلَا إِثْمَ عَلَيْهِ ۚ إِنَّ اللَّهَ غَفُورٌ رَحِيمٌ  

{إنما حرم عليكم الميتة} أي أكلها إذا الكلام فيه وكذا ما بعدها وهي ما لم يذك شرعا، وألحق بها بالسنة ما أبين من حيِّ وخُص منها السمك والجراد {والدم} أي المسفوح كما في الأنعام {ولحم الخنزير} خص اللحم لأنه معظم المقصود وغيره تبع له {وما أهل به لغير الله} أي ذبح على اسم غيره والإهلال رفع الصوت وكانوا يرفعونه عند الذبح لآلهتهم {فمن اضطر} أي ألجأته الضرورة إلى أكل شيء مما ذكر فأكله {غير باغ} خارج على المسلمين {ولا عاد} متعد عليهم بقطع الطريق {فلا إثم عليه} في أكله {إن الله غفور} لأوليائه {رحيم} بأهل طاعته حيث وسع لهم في ذلك وخرج الباغي والعادي ويلحق بهما كل عاص بسفره كالآبق والماكس فلا يحل لهم أكل شيء من ذلك ما لم يتوبوا وعليه الشافعي.

See similar narrations below:

Collected by Qurʾān
quran: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."  

Say: ‘I do not find, in what is revealed to me, anything forbidden to him who eats thereof except it be (read yakūn or takūn) carrion (maytatan; or if read maytatun, then with the form yakūn, ‘it be’, preceding it) or blood poured forth, flowing, as opposed to ˹the case of˺ a liver or a spleen; or the flesh of swine — that indeed is an abomination, forbidden, or, except it be, a wicked thing that has been hallowed to other than God, that is to say, it has been slaughtered in the name of someone else. But whoever is constrained, to do any of what has been mentioned, and he consumes it, neither coveting nor transgressing, then surely your Lord is Forgiving, to him for what he has consumed, Merciful’, towards him. To these ˹prohibited things˺ the Sunna adds all beasts of prey with canine teeth and birds ˹of prey˺ with talons.
القرآن:٦:١٤٥

قُلْ لَا أَجِدُ فِي مَا أُوحِيَ إِلَيَّ مُحَرَّمًا عَلَىٰ طَاعِمٍ يَطْعَمُهُ إِلَّا أَنْ يَكُونَ مَيْتَةً أَوْ دَمًا مَسْفُوحًا أَوْ لَحْمَ خِنْزِيرٍ فَإِنَّهُ رِجْسٌ أَوْ فِسْقًا أُهِلَّ لِغَيْرِ اللَّهِ بِهِ ۚ فَمَنِ اضْطُرَّ غَيْرَ بَاغٍ وَلَا عَادٍ فَإِنَّ رَبَّكَ غَفُورٌ رَحِيمٌ  

{قل لا أجد فيما أوحي إليَّ} شيئا {محرَّما على طاعم يطعمه إلا أن يكون} بالياء والتاء {ميتة} بالنصب وفي قراءة بالرفع مع التحتانية {أو دما مسفوحا} سائلا بخلاف غيره كالكبد والطحال {أو لحم خنزير فإنه رجس} حرام {أو} إلا أن يكون {فسقا أهل لغير الله به} أي ذبح على اسم غيره {فمن اضطرَّ} إلى شيء مما ذكر فأكله {غير باغ ولا عاد فإن ربَّك غفور} له ما أكل {رحيم} به ويلحق بما ذكر بالسنة كل ذي ناب من السباع ومخلب من الطير.
quran:16:115

He has only forbidden to you dead animals, blood, the flesh of swine, and that which has been dedicated to other than Allah. But whoever is forced ˹by necessity˺, neither desiring ˹it˺ nor transgressing ˹its limit˺ - then indeed, Allah is Forgiving and Merciful.  

He has forbidden you only carrion, blood, the flesh of swine, and that which has been hallowed to other than God. Yet whoever is compelled, neither craving nor transgressing, then truly God is Forgiving, Merciful.
القرآن:١٦:١١٥

إِنَّمَا حَرَّمَ عَلَيْكُمُ الْمَيْتَةَ وَالدَّمَ وَلَحْمَ الْخِنْزِيرِ وَمَا أُهِلَّ لِغَيْرِ اللَّهِ بِهِ ۖ فَمَنِ اضْطُرَّ غَيْرَ بَاغٍ وَلَا عَادٍ فَإِنَّ اللَّهَ غَفُورٌ رَحِيمٌ  

{إنما حرم عليكم الميتة والدم ولحم الخنزير وما أهل لغير الله به فمن اضطر غير باغ ولا عاد فإن الله غفور رحيم}.