There may be nothing more frustrating than your Mac freezing on you in the middle of a task, but another scenario that’s likely to give you heartburn is when your Mac keeps restarting all by itself. Is it malware? Is it a ghost? Or is your MacBook playing a prank on you?
Well, we can safely rule out ghosts, and your MacBook wasn’t programmed with a sense of humor. Therefore, the cause is either malware or a more innocent explanation, which we’ll investigate in this article.
Why does my Mac keep restarting?
Before we get into solutions, let’s take a look at some of the reasons why your MacBook is crashing.

macOS updates have a bug
Apple has a pretty solid track record of creating updates that don’t cause unexpected problems on a MacBook. However, accidents can happen, and a random update could result in a bug that makes your Mac keep restarting.
If something about your MacBook causes a miscommunication when the latest update is installed, you could be left waiting until Apple rolls out its next update to hopefully patch the issue. Consequently, your MacBook might be unusable in the meantime.
Software or third-party apps are causing random restarts
The problem could be a specific piece of software or a third-party app installed on your Mac. Whether it’s your web browser or a sketchy piece of software that you downloaded from outside the Mac App Store, it’s a less-than-ideal scenario.
This is a classic reason why you should only download software and apps from the Mac App Store and from Apple-recognized developers. You never know how your Mac is going to react to something you randomly found on the web. Plus, this type of software can also have malware.
You have malware
In many people’s minds, malware is a nightmare scenario they don’t even want to think about. But if you’ve gone through all of the other possible options, malware is one of the few possibilities left.
The good news is that it is relatively easy to check for malware and remove it, provided that you have the right anti-malware software and you’re not dealing with ransomware. If you do have ransomware, it’s a completely different set of circumstances.

The Mac hardware is malfunctioning

Of course, when your Mac keeps restarting, it’s natural to wonder if the hardware inside is broken or dying.
As your MacBook gets older and you use it more and more, the internal components naturally suffer wear and tear. We’ll discuss how to diagnose this problem later in this article.
External drives are tripping up your device
We’ve already mentioned how software and apps from outside the Mac App Store can lead to problems that cause your Mac to keep restarting. The same can be said for peripheral devices that are of low quality and can conflict with your MacBook.
Cheap China-made models of peripheral devices like USB sticks, external hard drives, or Bluetooth dongles are among the usual suspects.
Your charger or battery is having issues

If you still haven’t located the reason why your MacBook keeps restarting, check the charger or the battery, as it’s possible that the power supply is unstable.
If your MacBook keeps restarting while charging, the charger itself could be faulty. If it only happens while on battery power, this will help you narrow down the source of the problem.
Why does your Mac say, “Your computer was restarted because of a problem”?

Users of Windows computers will be very familiar with the Blue Screen of Death. On a Mac, the equivalent of the BSOD is a kernel panic. If your Mac comes up against a system-level error that it cannot recover from, then it force-reboots to protect itself.
If you get the error message “Your computer was restarted because of a problem,” a kernel panic may be to blame. It can be caused by one of the following possibilities:
- You have defective RAM.
- You have a VPN or an antivirus that is conflicting with your MacBook (thankfully, this is not the case with ClearVPN or CleanMyMac).
- Your hard drive or SSD is defective or dying.
- You have old or incompatible software.
- A peripheral that you’re trying to plug into your MacBook could have bad firmware.
- You have other technical problems with internal components, such as the graphics card or the logic board.
- Your Mac is overheating.
How to fix a Mac that keeps restarting
Hopefully, one of the possibilities that we’ve outlined above is the culprit. Now, it’s time to give you solutions that will clear it up.
Check your Mac for malware or viruses

Let’s try to rule out the worst possibility first by checking your MacBook for malware or viruses. For this, you’re going to need a powerful, lightweight anti-malware app, such as CleanMyMac, powered by Moonlock engine.
CleanMyMac is a Mac optimization tool that also has a malware detection feature. If there is even the remotest possibility that you have malware, it’s a good idea to have CleanMyMac in your corner.

Sign up now to get a free trial to try CleanMyMac for yourself. Then simply install CleanMyMac and follow these easy steps:
- Select the Protection feature in the left sidebar.
- Click Configure Scan and select everything in the scan settings. Then exit that screen to return to the main menu.
- Click the Scan button to begin the malware search process.
- If malware is found, CleanMyMac will show it to you. Select all discovered threats and click Remove.
- Select Cleanup in that same sidebar where you found Protection. Running the Cleanup feature will locate and remove all unnecessary junk files, some of which could be linked to the malware that was just found.
Roll your Mac back to a previous state

Unfortunately, there is no handy “rollback” button that will nuke buggy installs or updates. If you can’t wait for the next patch to be released to hopefully fix things, then there are 2 other options.
If you use Time Machine, you can return the whole MacBook to a previous state. You can also utilize an iCloud backup to return the Mac to a state before the update was applied.
No backups? You should always be making backups. But if you have none, you may need to wait for Cupertino to send you the next patch.
Uninstall free software
If you did fall into the trap of installing software from outside the Mac App Store, uninstall it immediately. In addition to the fact that it could have malware, it may be the cause of your Mac system restart.

Make sure you uninstall the software completely, including removing all related files and removing it from the Login Items section in System Settings. You can ensure that all related files are removed by using CleanMyMac.
Oh, and don’t forget to empty the trash bin.
Stop using incompatible peripherals
If you’re convinced that the problem is coming from a dodgy USB stick or external hard drive, then of course, disconnect it and stop using it.
Peripherals such as hard drives and USB sticks can be expensive. Therefore, it can be naturally very tempting to cheap out and buy something for $5. But you could actually be doing your MacBook a disservice by not spending a bit more for a higher-quality product.
Try another charger
Still having issues? Then it’s time to take a closer look at the charger.
The best way to do this is to try another charger and see if the problem persists. Look to see how long it takes to charge the battery. If it’s taking too long, you could have a power supply imbalance with the Mac. The only way to solve this is to buy a new charger.
What to do if your Mac still keeps restarting after you tried everything
If your Mac keeps restarting and nothing has worked so far, there are still a few things you can try before giving up.
Wipe and reset the MacBook to factory settings
Before you give up and take the MacBook to an Apple Store, you could try one last thing. This is to completely wipe and reset the MacBook back to factory settings.
This used to be a long and complicated process, but Apple has greatly simplified and streamlined the process in recent years with newer Macs. We previously published an in-depth tutorial on how to wipe and reset your Mac. We also made a YouTube video.
Take the MacBook to an Apple Store to have it looked at
If it turns out to be a technical problem with the battery, the logic board, RAM, or another piece of essential hardware, the only course of action is to take the Mac to an Apple Store or to an Apple-recognized engineer. It is extremely difficult to open the MacBook and fix it yourself, which is the way Apple designed it.
If your MacBook is under an AppleCare warranty, you’re in luck when it comes to the repair costs. Otherwise, this could prove to be expensive.
How to reduce random Mac restarts and keep your system stable
As the saying goes, an ounce of prevention is worth a pound of cure. Observe the following tips to ensure that random Mac restarts are as rare as possible.
Run regular malware scans with CleanMyMac
To prevent malware from becoming a problem with your MacBook restarting, make sure to run a scan at least once a week. More scans wouldn’t hurt, but aim for at least once a week.
Be selective with app installations

Only install apps from the Mac App Store or an Apple-recognized developer. That cool-looking app from a sketchy website should be avoided.
Make sure that macOS and all apps are updated quickly
It is natural to procrastinate and delay doing tasks you find tiresome and tedious. However, as unexciting as updating your MacBook may seem, it’s vital to your personal cybersecurity. Otherwise, you could end up with lots of problems later.
Continually check Login Items

If you have a problematic app or background process that causes your Mac to keep restarting, you don’t want it automatically logging in when your MacBook boots up.
Be sure to frequently check the Login Items section in System Settings and remove any unnecessary apps.
Frequently back up your MacBook
If your MacBook keeps restarting because of a buggy update, the fastest way to reverse the problem is to roll back your Mac to a previous version. The only way to do this is to use a backup.
If you’re not utilizing backups, start by using Time Machine or an iCloud backup. These can be run automatically in the background, so you don’t even have to think about it. But you’ll be glad later if you need it.
A MacBook is like any other type of electrical device. Although it is a premium, well-made product, it will also eventually become prone to glitches and problems.
By narrowing down the list of culprits, you’ll be able to quickly find out what the issue is. Provided it’s not a hardware issue requiring the attention of Apple, you can usually fix it yourself.
This is an independent publication, and it has not been authorized, sponsored, or otherwise approved by Apple Inc. Mac, MacBook, and macOS are trademarks of Apple Inc.