Short answer
No. IVF is allowed when the egg is the wife's, the sperm is her husband's, the embryo is placed in the wife's own womb, and all of it happens while they are married. Any third party, such as donor sperm, donor eggs, a donor embryo or another woman's womb, makes it haram. Hanafi muftis and contemporary scholars of all four schools agree on this.
IVF and IUI with the couple's own sperm and eggs during a valid marriage are permissible as treatment for infertility, provided strict safeguards prevent any mix-up of samples and the awrah is uncovered only as far as treatment needs. Using any third party's sperm, eggs, embryos or womb is haram.
The four schools agree on this.
Explanation
Infertility is a test, and seeking treatment for it is as allowed as treating any other condition. The Quran says that Allah gives children to whom He wills and makes barren whom He wills, and trying permitted treatment does not go against that. Many couples have had children through IVF after years of dua.
The conditions scholars set are:
- the sperm is the husband's and the egg is the wife's
- the marriage is valid at the time of transfer, so never after divorce or the husband's death
- the embryo is placed in the wife's own womb
- the clinic is trustworthy and has safeguards against samples being mixed
Uncovering the awrah for tests and procedures is allowed because of the need, but a female specialist is preferred where one is available. Many muftis allow the husband to produce a sample by masturbation for this purpose because of the need, though with his wife's help is better.
Spare embryos must never be given to another couple. Many scholars allow the couple to freeze embryos for their own later cycles while the marriage lasts. What to do with embryos left over at the end of treatment is a question to put to a mufti. The four schools have no classical ruling on IVF itself, and contemporary councils from all of them, such as the OIC Islamic Fiqh Academy, agree on the conditions above.
For the third-party cases, see donor sperm and eggs and surrogacy. A dua that many couples make is in dua for children.
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 Ash-Shura 42:49-50
لِّلَّهِ مُلْكُ ٱلسَّمَٰوَٰتِ وَٱلْأَرْضِ ۚ يَخْلُقُ مَا يَشَآءُ ۚ يَهَبُ لِمَن يَشَآءُ إِنَٰثًۭا وَيَهَبُ لِمَن يَشَآءُ ٱلذُّكُورَ ﴿٤٩﴾ أَوْ يُزَوِّجُهُمْ ذُكْرَانًۭا وَإِنَٰثًۭا ۖ وَيَجْعَلُ مَن يَشَآءُ عَقِيمًا ۚ إِنَّهُۥ عَلِيمٌۭ قَدِيرٌۭ ﴿٥٠﴾
To Allah belongs the dominion of the heavens and the earth; He creates what he wills. He gives to whom He wills female [children], and He gives to whom He wills males. Or He makes them [both] males and females, and He renders whom He wills barren. Indeed, He is Knowing and Competent.
Children are Allah's gift, and seeking permitted treatment is part of asking Him for it.
Quran, Surah Al-Baqara 2:223
نِسَآؤُكُمْ حَرْثٌۭ لَّكُمْ فَأْتُوا۟ حَرْثَكُمْ أَنَّىٰ شِئْتُمْ ۖ وَقَدِّمُوا۟ لِأَنفُسِكُمْ ۚ وَٱتَّقُوا۟ ٱللَّهَ وَٱعْلَمُوٓا۟ أَنَّكُم مُّلَٰقُوهُ ۗ وَبَشِّرِ ٱلْمُؤْمِنِينَ ﴿٢٢٣﴾
Your wives are a place of sowing of seed for you, so come to your place of cultivation however you wish and put forth [righteousness] for yourselves. And fear Allah and know that you will meet Him. And give good tidings to the believers.
Conception belongs within the marriage of husband and wife, which is why only their own sperm and egg may be used.
Sahih al-Bukhari 5678
Sahih... ما أنزل الله داء إلا أنزل له شفاء ...
"Allah has not sent down any disease except that He has also sent down a cure for it."
Infertility is a condition that may be treated.
Sahih Muslim 2204
Sahih... لكل داء دواء فإذا أصيب دواء الداء برأ بإذن الله ...
"Every disease has a remedy, and when the right remedy is found, the disease is cured by Allah's permission."
Treatment is a means, and the result is from Allah.
Where the ruling is recorded
- Resolutions of the Islamic Fiqh Academy (OIC), Resolution on test-tube babies. Allows only methods using the husband's sperm and the wife's egg placed in her own womb during marriage.
- Jadid Fiqhi Masa'il (Khalid Saifullah Rahmani), Chapter on test-tube babies. A Hanafi treatment of the conditions for IVF and the prohibition of third parties.
This answer is pending review by the scholars on our team. 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.