Short answer
No. Islam does not divide magic into black and white. Magic (sihr) is haram whatever the intention, whether to heal, protect, bring luck or win someone's love, because it works through hidden means involving devils and words or acts of disbelief. The lawful ways to seek healing, protection and love are dua, ruqyah and ordinary means. The four schools agree.
All sihr is haram, and it is kufr when it involves words, beliefs or acts of disbelief. A good intention does not make it permitted, and love charms (tiwalah) are named in the hadith as shirk.
The four schools agree on this.
Explanation
'White magic' usually means spells, charms, crystals, candle rituals or Wicca-style practices done for a good aim: healing, protection, luck, or making someone love you. The Quran describes magic as something people learn which harms them and does not benefit them (2:102). It makes no exception for good magic.
The Prophet ﷺ said that spells, amulets and tiwalah are shirk. Scholars explain tiwalah as a charm made to make a wife beloved to her husband. So a love spell is named as shirk even though its aim, love in marriage, is good. The Hanafi scholars explain that the spells meant here are the pre-Islamic kind, full of shirk, while ruqyah with the Quran is sunnah.
The same applies to undoing magic with magic. When asked about nushrah (undoing a spell), the Prophet ﷺ called it the work of Satan. A good aim never makes a forbidden means lawful.
- For healing and protection: ruqyah, the adhkar and medicine.
- For love in marriage: dua, kindness and honest effort, as in dua for your spouse.
- For luck: nothing happens apart from Allah's decree, so make dua and pray istikharah.
Anyone who has used such spells should stop, repent and renew their faith. Stage illusions that everyone knows are tricks are a separate question, covered in is magic haram.
The evidence
Quran, Surah Al-Baqara 2:102
وَٱتَّبَعُوا۟ مَا تَتْلُوا۟ ٱلشَّيَٰطِينُ عَلَىٰ مُلْكِ سُلَيْمَٰنَ ۖ وَمَا كَفَرَ سُلَيْمَٰنُ وَلَٰكِنَّ ٱلشَّيَٰطِينَ كَفَرُوا۟ يُعَلِّمُونَ ٱلنَّاسَ ٱلسِّحْرَ وَمَآ أُنزِلَ عَلَى ٱلْمَلَكَيْنِ بِبَابِلَ هَٰرُوتَ وَمَٰرُوتَ ۚ وَمَا يُعَلِّمَانِ مِنْ أَحَدٍ حَتَّىٰ يَقُولَآ إِنَّمَا نَحْنُ فِتْنَةٌۭ فَلَا تَكْفُرْ ۖ فَيَتَعَلَّمُونَ مِنْهُمَا مَا يُفَرِّقُونَ بِهِۦ بَيْنَ ٱلْمَرْءِ وَزَوْجِهِۦ ۚ وَمَا هُم بِضَآرِّينَ بِهِۦ مِنْ أَحَدٍ إِلَّا بِإِذْنِ ٱللَّهِ ۚ وَيَتَعَلَّمُونَ مَا يَضُرُّهُمْ وَلَا يَنفَعُهُمْ ۚ وَلَقَدْ عَلِمُوا۟ لَمَنِ ٱشْتَرَىٰهُ مَا لَهُۥ فِى ٱلْءَاخِرَةِ مِنْ خَلَٰقٍۢ ۚ وَلَبِئْسَ مَا شَرَوْا۟ بِهِۦٓ أَنفُسَهُمْ ۚ لَوْ كَانُوا۟ يَعْلَمُونَ ﴿١٠٢﴾
And they followed [instead] what the devils had recited during the reign of Solomon. It was not Solomon who disbelieved, but the devils disbelieved, teaching people magic and that which was revealed to the two angels at Babylon, Harut and Marut. But the two angels do not teach anyone unless they say, "We are a trial, so do not disbelieve [by practicing magic]." And [yet] they learn from them that by which they cause separation between a man and his wife. But they do not harm anyone through it except by permission of Allah. And the people learn what harms them and does not benefit them. But the Children of Israel certainly knew that whoever purchased the magic would not have in the Hereafter any share. And wretched is that for which they sold themselves, if they only knew.
Magic is described as harmful without exception.
Sunan Abi Dawud 3883
Graded sahih... إن الرقى والتمائم والتولة شرك ...
"Spells, amulets and love charms are shirk."
Even magic for love, a good aim, is named as shirk.
Sunan Abi Dawud 3868
Grading to be checked... عن النشرة فقال هو من عمل الشيطان ...
"He was asked about nushrah and said: It is from the work of Satan."
Using magic to undo magic is forbidden.
Where the ruling is recorded
- al-Durr al-Mukhtar, Muqaddimah, on knowledge that is forbidden to learn. Counts sihr among forbidden fields of knowledge, without exception for its purpose.
- Radd al-Muhtar (Ibn Abidin), Kitab al-Hazr wa al-Ibaha, discussion of amulets and tiwalah. Explains tiwalah as a love charm and why it is forbidden.
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.