You’re working on an assignment, surfing the web, or doing some other important task. Suddenly, your Mac shuts down randomly and, apparently, for no reason. Usually, this is just a one-time occurrence and never happens again. But if you’re dealing with a Mac that habitually shuts down with no warning, you may have bigger issues.

Here are some troubleshooting tips and tools to help fix your Mac.

What to Do When Your Mac Keeps Shutting Down

When you experience a random Mac shutdown, the first and most important step is to complete a proper shutdown procedure. Is it necessary? Yes, because background processes and programs don’t always close correctly during a random shutdown. So boot up your Mac, then restart it again.

The cause of an unexpected shutdown could range from problems either in the hardware or software. Whatever may be the reason, these events get recorded in the log (Utilities > Console). With macOS Sierra or later, Console does not give you access to older log entries, and as a result, you may not see them in “system.log” file. But there is a way to get information from Terminal.

Just run the following command: log show --predicate ’eventMessage contains "Previous shutdown cause"’ --last 24hr This command simply extracts the shutdown event message that happened within the last 24 hours. If your Mac did shut down randomly, you’ll see the timestamp details along with the “error code.” This StackExchange discussion on shutdown causes and this archived AppleCare document list some common error codes:

  • –3: multiple temperature sensors too high
  • –60: bad master directory block, serious disk error
  • –61 or –62: unresponsive app resulting in forced shutdown
  • –64: kernel panic, probably due to firmware issue
  • –74: battery too hot
  • –86, –95: proximity temperature too high
  • –104: unknown battery fault
  • 3: forced shutdown
  • 5: clean shutdown
terminal command to decipher the cause of Mac shutdown

The error codes in negative refer to hardware originating mainly from the System Management Controller (SMC), and those that are positive refer to software. If you see a negative “error code,” and rebooting does not solve the problem, Apple recommends resetting the Mac’s SMC.

How to Reset the SMC

The SMC is a chip in Intel-based Macs. It controls many important components like LED indicators, sensors, cooling fans, and power buttons. At the same time, it plays a role in the behavior of your hard drive, how your Mac behaves in sleep mode, and the power supply.

Before you begin, Apple recommends you take the following steps:

  1. Shut down your Mac.
  2. Press and hold the power button for 10 seconds, then release the button.
  3. Wait for a few seconds, then press the power button again to turn on your Mac.

If the issue persists, follow the steps in our guide to reset the SMC. The procedure depends on whether you own a desktop or laptop Mac, whether the battery is removable or non-removable, and whether it includes the T2 security chip or not.

Apple macbook pro
Image Credit: Apple

Macs with an M1 or M2 chip don’t have an SMC, so there’s no point in trying to reset it. If you suspect a problem with features associated with the SMC, then follow these steps:

  1. Shut down your Mac.
  2. Disconnect all non-essential peripherals and the main power lead.
  3. Wait for a few moments and restart your Mac.

Overheating

If the heat builds up inside your Mac, it may shut itself down to prevent damaging its internal components. In most cases, improper placement of the machine may result in a random shutdown. We recommend you to keep the laptop on a flat surface to allow proper airflow.

Macbook air
Image Credit: Apple

You might want to clean out the air vents with compressed air to prevent blockages. Also, as a precaution, we advise you don’t use MacBooks at a temperature above 95 degrees. Here are some tips and tricks to cool down an overheating MacBook.

Maintaining a Healthy Mac

Macs last for a long time, but they can develop problems with age. Thankfully, you can take some steps to make sure your Mac continues to run smoothly through the years.

Monitor Your Battery

Rechargeable batteries don’t last forever. Usage of your MacBook battery accrues in the form of charge cycles. Each battery is only suitable for a limited number of charge cycles. At that point, the battery is consumed, and you’ll need to replace it.

You can view your Mac’s current battery cycle count by heading to the Apple menu and selecting About This Mac. Select System Report and then navigate to the Power subsection under Hardware. Under Battery Information, you’ll see the current Cycle Count.

Mac power battery check

A charge cycle means using all the battery’s power, not necessarily a single charge. For example, discharging from 100 to 50 percent battery, then charging back to 100 percent before discharging to 50 percent again, counts as one cycle. The maximum cycle count varies by model.

Some early MacBooks only offered 300 cycle counts, while newer models usually last for up to 1,000 cycle counts. With Optimized battery charging selected in System Preferences > Battery, macOS intelligently chooses when to charge above 80 percent to help preserve battery healthy in the long run. To learn more, read about optimized battery charging on Apple devices and the way it works.

Third-Party Tools Do Even More

A great choice when you’re looking to find out more about your Mac’s battery is Battery Monitor ($4.99). The app goes beyond cycle counts and explains information in less technical terms, so you can track battery temperature, status, design capacity, and more.

battery dashboard showing charge cycles

Among other details, you can even view the total number of charge cycles, the maximum capacity for the battery pack as shipped, and the current capacity. Checking your battery’s temperature is also important. A battery that frequently overheats suggests bigger issues.

Reading the Logs

The less you need to charge your battery, the longer the battery should last and the healthier your computer will remain. Thus, apps that are consistent battery hogs can cause long-term damage to your investment. To see which apps are consuming the battery, click the battery icon in the menu bar and see the list of apps under Using Significant Energy.

Mac apps using significant energy

We also recommend you use Activity Monitor to show you the apps and services using up the CPU. Pay careful attention to the items located under the CPU and Energy tabs, as large numbers here could be troublesome. Here is our guide on Activity Monitor to see what’s happening in your Mac.

Save Your Energy

You should also check your computer’s Energy Saver settings, located in the System Preferences. For most users, the default settings are appropriate. Click Restore Defaults for those settings.

Calibrating Your MacBook Battery

Apple’s newer laptops don’t have to go through the same calibration process anymore. Older models that were non-unibody in design, with removable batteries, did benefit from periodic calibration.

The purpose of calibration is to estimate of the time remaining before the battery needs a recharge. To help lengthen the life of your laptop, check out these tips to improve MacBook battery life.

What If Your Mac Keeps Shutting Down Randomly?

If your Mac keeps shutting down randomly, even after using the troubleshooting tools mentioned above, it’s time to visit an Apple Store or an Apple approved service provider. You can also contact the company through Apple Support.

For any Mac not currently under warranty, another option to consider is a third-party repair center. These can often fix the issue for much less than going directly through Apple.