MainspringGuides › Random shutdowns
macOS Guide

Mac Shutting Down Randomly? Causes and Fixes

Updated August 2026 · 5 min read

A Mac that switches off with no warning and no message is different from one that crashes or restarts. There's no dialog, no report, nothing on screen — it's as if the plug was pulled, which is usually close to what happened. The good news is that macOS records a reason code every time, and reading it back takes one command.

Make sure it's a shutdown

Three failures get described the same way, and the fixes have nothing in common:

Read the recorded cause

macOS logs why the last shutdown happened. Open Terminal and run:

# Print every recorded shutdown cause from the last week (read-only)
log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 7d

You'll get one line per boot, each ending in a number. How to read them:

Note the timestamps and compare them with what you were doing. That correlation is usually more diagnostic than the code itself.

Cause 1: heat

A Mac that shuts down to protect itself will do it under sustained load — a long video call, an export, a game, a compile — and rarely when idle. If the machine was hot and loud beforehand, this is where to start.

Check the vents for dust, get the Mac off soft surfaces, and see whether the shutdowns stop when the load does. The overheating guide and the fan guide cover the fixes; if kernel_task was also high, that's the throttling mechanism and confirms heat was involved.

Cause 2: the battery, on a laptop

This is the most common cause on any MacBook more than a few years old. A worn battery can no longer supply the current the Mac demands under load, so it cuts out — often at a percentage well above zero, and often the moment something demanding starts.

  1. Open System Settings → Battery and click the next to Battery Health. Service Recommended is a direct answer.
  2. Check the cycle count: hold Option, click the Apple menu → System Information, and select Power. Recent MacBooks are rated for 1000 cycles.
  3. Test on mains power. If the Mac never shuts down while plugged in and does so on battery, that's your answer.

How to check battery health properly. A battery replacement is far cheaper than a Mac and is often the thing keeping a good machine out of service.

Cause 3: power delivery

On desktops and on laptops that shut down while charging:

Cause 4: software, less often

Software rarely causes a true power-off, but a system extension interacting badly with power management can. Two tests, in this order:

  1. Disconnect every peripheral and use the Mac bare for a day.
  2. Boot into Safe Mode and work there. Third-party extensions don't load, so if the shutdowns stop, something installed is involved — check System Settings → General → Login Items & Extensions.

Also install any pending updates: System Settings → General → Software Update. Power-management bugs do get fixed in point releases.

When it's the Mac that's asleep, not off

Worth ruling out: a Mac that appears to have shut down may just have slept and be refusing to wake. If the power light or fan behaviour suggests it's still powered, the problem is wake rather than shutdown, and disconnecting displays and peripherals is the first test. Turning off Power Nap is worth trying if it also wakes and sleeps unpredictably.

Run Apple Diagnostics

If nothing above isolates it, test the hardware. Disconnect everything except the keyboard, mouse, display and power, then:

It runs for a few minutes and gives you a reference code. Write it down — it's the first thing a repair centre will ask for, and it turns “it randomly switches off” into something actionable.

On Intel Macs only: the SMC

The System Management Controller governs power and thermal behaviour on Intel Macs, and resetting it occasionally clears stuck shutdown behaviour. On an Intel laptop with a T2 chip: shut down, hold Control + Option + Shift (left side) for seven seconds, add the power button for another seven, release, then start up. Apple silicon Macs have no user-resettable SMC — the equivalent is a full shut down left off for thirty seconds.

The settings-level fixes above are one-click, reversible toggles in Mainspring — labelled in plain English, with an undo button for every one.

Common questions

Why does my Mac shut down without warning?

The most common causes are a worn laptop battery that can no longer supply peak current, thermal protection cutting in under sustained load, and unstable power from a failing charger, cable or dock. macOS records a shutdown cause you can read back in Terminal.

How do I check why my Mac shut down?

Run the log show command with a predicate for 'Previous shutdown cause' in Terminal. Values of 0 and 5 mean a clean shutdown, 3 means power was cut, and negative values indicate an abnormal shutdown worth correlating with what you were doing.

Can a bad battery cause a MacBook to shut down at 40 percent?

Yes, and it is a classic symptom. A degraded battery reports a percentage it cannot actually deliver under load, so the Mac cuts out well above zero, typically the moment something demanding starts.

Does overheating cause a Mac to shut down?

It can. macOS throttles first, and shuts down as a last resort to protect the hardware. Shutdowns that only happen during sustained load, after the Mac has been hot and loud, point this way.

Should I reset the SMC if my Mac keeps shutting down?

On Intel Macs it is worth trying, since the SMC controls power and thermal behaviour. Apple silicon Macs have no user-resettable SMC; a full shut down for thirty seconds is the equivalent.

Rule the software side out cleanly

Diagnosing hardware means eliminating variables. Mainspring keeps the macOS-settings variable honest: 90+ hidden options as labelled toggles, with a change history and one-click undo, so you always know exactly what's been changed and can put it all back.

Try Mainspring free →

Signed & notarized by Apple · 1-day free trial · $29 once