Picture the scene. You’re using ChatGPT to write your homework essay or watching skateboarding dogs on YouTube. Suddenly, your expensive MacBook shuts down, and you’re left wondering if you’ll be forced to use a Windows device.
Well, don’t worry. This random shutdown may be something that requires a Genius store visit — but it might not, either. Read on to find out the possible causes, solutions, and proactive steps you can take to avoid future occurrences.
Why does my MacBook keep turning off on its own?
Let’s first address the elephant in the room. Yes, it could be malware. If your Mac is being overtaxed by a trojan or virus, it will likely give up eventually and shut down.
However, there are many other possibilities. We’ve highlighted them below. Check to see which ones apply to you so you can quickly narrow down the reason why your MacBook shuts down. We’ll be supplying solutions in the section after that.
The battery is toast
The first possible issue that should be investigated when your MacBook shuts down is the battery. The battery supplies the juice, so if it goes, so does the MacBook itself.
Batteries can be replaced (at a hefty cost to you) but only at an Apple store or by an Apple-recognized engineer.
The Mac is overheating

Another possibility that might make a MacBook wave the white flag and collapse is excessive heat. Heat inside an electrical device is obviously normal.
A laptop’s internal fans usually do the job of keeping the insides cool. But there’s a limit to acceptable heat. If the temperature gets too high, the Mac will shut down.
Your charger is malfunctioning

If your MacBook keeps shutting down, the charger could be to blame. The battery may be perfectly fine, but if the charger isn’t providing enough power to the device, it won’t be long before the battery runs out and the laptop goes down.
MacBook chargers from Apple will likely not give you this issue (unless they’re really old). But if you buy a cheap knock-off charger from China, anything can happen.
You’ve got malware

Last of all, the doomsday scenario is that you have malware. If you’ve clicked on a pop-up ad, clicked an email link, plugged in a strange USB stick, or visited a sketchy website, you could have gremlins running about and causing havoc inside your MacBook.
But if your Mac’s symptoms have been limited to shutting off randomly, chances are you’re dealing with a cryptojacker, which isn’t the most dangerous variety of malware. Nevertheless, you should still install Moonlock and run a malware scan to find it and get rid of it.
You have a hardware issue (not the battery)

Other than the battery, there are lots of other pieces inside the chassis that could be causing problems. As the MacBook gets older, hardware components are going to go through wear and tear.
Unfortunately, this is something only an Apple store or a recognized Apple engineer can fix. Despite the EU’s “right to repair” ruling, Apple doesn’t make it easy for the ordinary customer to open things up and go rooting about inside.
The new version or update of macOS is buggy

This doesn’t happen very often. Most of the time, Apple thoroughly tests its updates before releasing them. But occasionally, a bug or two slips through the cracks, temporarily obstructing MacBooks until Apple rushes out another update.
There’s no way to roll back an update once it’s installed. Consequently, you just have to hope and pray that the next update comes out quickly.
How to stop your MacBook from turning off automatically
Now that we’ve shared the possible reasons why your MacBook shuts down randomly, it’s time to provide some practical solutions.
Detect and remove malware from your Mac
While it may be an unwelcome guest, most malware targeting the average user is easy to get rid of using the right tools. A reliable anti-malware program has all the necessary equipment to find and safely remove malware in minutes.
But when it comes to MacBooks, you need a solution that’s been designed specifically for Apple products. Moonlock is an easy-to-use, lightweight, and powerful anti-malware tool that you can rely on to keep your Mac in top condition.

Get ready to run your first malware scan to fix random shutdowns:
- Start your free trial of Moonlock.
- Open the app, then click on the Malware Scanner tab from the left sidebar (it’s the sunglasses icon).
- From the drop-down menu, click Configure. You only need to do this for your first scan. Moonlock will remember your preferences for all future scans.
- A new window will pop up with additional security configurations. Under “Scan type,” you can choose between Quick, Balanced, and Deep scan. You’ll find each scan type’s Speed, Depth, and Purpose outlined right below.
- We recommend that you opt for a Deep scan, and then include all optional file formats available: archives, disk images (DMG), and packages (PKG).
- Once you’re done, exit the pop-up window. Click Scan.
With a Deep scan, Moonlock will methodically sift through all the files on your Mac, looking for all sorts of threats that might be lurking in some obscure corner. If it finds anything, it’ll immediately isolate it in Quarantine, preventing it from further interacting with your system and files.
When the scan is complete, Moonlock will present you with a list of all the malware it found for you to inspect. You can then have Moonlock safely and fully remove them from your Mac.

Keep the charger plugged in
Assuming the charger isn’t the issue, just keep it plugged in to keep the battery going while you schedule an appointment with an Apple store.
If the battery is on life support anyway, leaving the charger plugged in all the time isn’t going to make things any worse.
Turn off some System Settings options

Apple always pushes you to put your Mac to sleep when you’re not using it. But if an issue is causing it to shut down all the time, then putting it to sleep is perhaps not the best thing to do.
Go to System Settings > Lock Screen and disable the following:
- Start Screen Saver when inactive
- Turn display off on battery when inactive
- Turn display off on power adapter when inactive
Figure out what’s causing excessive MacBook heat

If your MacBook is extremely hot, try checking the apps and background processes that may be taxing the CPU.
Go to Activity Monitor, sort the apps so that the biggest guzzlers are at the top, then start force-quitting them.
Use the Amphetamine app to keep the MacBook awake

Don’t worry, we’re not talking about the illegal substance. Amphetamine is the name of a free Mac app that will stop your Mac from going to sleep, shutting down, or dimming the display.
Keep the MacBook in a cool place (but not too cool)
To help the MacBook maintain an optimal temperature, refrain from exposing it to warm environments. That will aggravate the problem. So, if you’re used to doing your work in a greenhouse, maybe get out of there.
That said, an overly cool environment is also bad for a MacBook battery. Keep the overall temperature somewhere in between, and you’ll be fine. Pro tip — if you’re sweating or shivering, move your MacBook elsewhere.
Visit an Apple Store
If this becomes a persistent problem, and you can’t fix it yourself, it’s time to get to an Apple store.
Just ask Siri to search for an “Apple store near me” or Google it. Alternatively, go to Apple Support and speak to someone.
When to seek professional help for issues with your MacBook shutting down
By “professional help,” we don’t mean seeing a therapist (although, if you love your MacBook dearly, this may be a necessary step for you). We’re talking about when to hire a professional to take the MacBook apart and fix it properly. Here’s when to seek the help of a pro:
- Your MacBook shuts down even when the charger is attached.
- You’ve changed the energy settings, and nothing has changed.
- Your battery gets hot to the touch. Turn the device off and take it to a pro before the thing explodes.
- You get lots of error messages. This could be an indication that your hardware is dying.
- You really can’t be bothered, or you don’t have the time. If you don’t want to spend time tinkering around, that’s what pros are there for.
Keep your Mac clean and healthy to prevent unexpected turn-offs
Once the problem is fixed, the last thing you want is a repeat of the situation. So, what should you do?
Keep the MacBook clean
A MacBook is a premium piece of equipment with a premium price tag to match. Take good care of it. Keep it clean, put it in a protective case when you’re not using it, and spray the charging sockets with compressed air once a week.
Run regular malware scans
The occasional malware here and there is inevitable, but that doesn’t mean you should accept and live with it. Running regular scans is one of the best ways you can maintain the safety of your files and the health of your Mac, allowing you to find and remove malware as soon as it steps foot on your device.
Moonlock has a built-in Scan Planner feature. With its help, you won’t have to remember to manually run scans. You can instead schedule scans to run at regular intervals, opting for the scan type that best suits your needs. The Scan Planner, in addition to many other security features, is included in your 7-day free trial of Moonlock.
Shut down all unnecessary apps
To avoid placing an intolerable strain on the CPU, shut down apps and processes you don’t need. Browsers are the biggest offenders (especially Chrome), so shut down those 100+ tabs you’ve got open and remove extensions you’re not using. It’s also a good idea to shut down the browser completely at least once a day.
Shut down the Mac completely
It’s common for users to keep their MacBooks running all the time, but this can be harmful to the device’s longevity. Therefore, every few days, shut down the MacBook completely and leave it be for a few hours.
Give your MacBook a break. Get outside, smell the roses, kiss a baby, and get an overpriced coffee.
It’s not necessarily the end of the world — or the end of your savings — if your MacBook starts to shut down by itself. As we’ve shown, there could be a multitude of other reasons, which are easily fixable. Give these a try and see if your Apple device comes back to life.
This is an independent publication, and it has not been authorized, sponsored, or otherwise approved by Apple Inc. Mac and MacBook are trademarks of Apple Inc.