Sometimes, formatting SD card fails due to several reasons: -If your SD card is write-protected, then formatting it will become indeed impossible. In this scenario, you have to make sure that the password is unlocked. -If the SD card is damaged or has been infected with malware, then formatting it won't be possible. So, make sure that it is virus-free. To accomplish that, use the card on a specific device and avoid using it on multiple devices. -A bad sector could lead to SD card not formatting problem as well. In this scenario, you can fix the problem using CMD and run the CHKDSK command (chkdsk E:\\/F), where E represents the SD card's drive and F is the repair parameter.