Mac, explained simply

Why does my Mac go to sleep when I close the lid?

Because macOS reads a closed lid as “I’m finished for now.” It isn’t a fault, and it isn’t a timer running out — it’s a deliberate instruction to sleep. Which is lovely, right up until the moment you wanted your Mac to keep going.

The short answer

There’s a small magnetic sensor that tells your Mac the lid has shut. The moment it trips, macOS suspends the machine — normally within a second or two. Nothing is waiting for you to stop typing, and no countdown is involved. Close, sleep.

Apple chose that behaviour for two good reasons:

  • Heat. An open MacBook sheds warmth through the keyboard and the gap at the hinge. Closed, most of that escape route is covered. A machine that’s asleep makes almost no heat, so closing the lid is safe by definition.
  • Battery. A sleeping Mac sips power for days. An awake one in a bag can flatten itself by lunchtime.

This is also why you won’t find a switch for it in System Settings. There’s a setting called “Prevent automatic sleeping when the display is off”, and people find it, turn it on, and are baffled when the lid still puts the Mac to sleep. That one governs a different kind of sleep — the kind that creeps in when you’ve walked away. Closing the lid isn’t that.

“But I have an external monitor and it still sleeps”

Then you’ve run into the thing that confuses nearly everybody. macOS does have a built-in arrangement for a MacBook parked next to a big screen — closed-display mode, or clamshell mode as most people call it. But it is not a way of keeping your Mac awake. It’s a way of using your Mac after you’ve woken it up again.

Apple’s conditions are short, and all three have to be true at the same time:

  • The Mac is connected to power.
  • An external display is connected.
  • An external keyboard and mouse or trackpad is connected.

And here’s the part most guides gloss over: you close the lid and it still goes to sleep. What clamshell mode gives you is that a tap on the external keyboard — or a click of the external mouse — then wakes it back onto the big screen, instead of you having to lift the lid. (Apple’s instructions are here.)

So if your monitor is plugged in and your Mac sleeps the moment you close the lid, nothing is broken and you haven’t missed a setting. That is clamshell mode working as designed. It sleeps first. You wake it.

If waking it with a keypress is all you ever needed, you’re done — no extra software, ours included. Read on if it isn’t.

Why clamshell mode isn’t enough for a lot of people

It falls short in five common ways:

  • Whatever was running gets interrupted. Because the Mac really does sleep in the gap, a download, backup, upload or export stops dead — and the network drops with it. Fine if you’re just stepping away from a desk. Useless if you closed the lidso that something could finish.
  • You’re on battery. Unplug, close the lid, and it sleeps — no waking it with a keypress, no exceptions. This catches people out constantly, because the same desk that worked yesterday fails the moment the charger is in another room.
  • There’s no external display. If you simply want the laptop shut and out of the way while a job finishes, or music keeps playing to a speaker, clamshell mode has nothing to offer you at all.
  • The wake-up doesn’t take. Bluetooth keyboards and mice quite often fail to rouse a sleeping Mac, especially through a hub, and you end up opening the lid to wake it — which rather defeats the point.
  • It can still doze off later. Clamshell mode doesn’t switch off the ordinary idle sleep. Wake it, leave it alone for long enough, and depending on your energy settings it can drop off again on its own.

Why “keep awake” apps often don’t fix it

This is the part that wastes people’s afternoons, so it’s worth being precise:macOS has two different sleeps.

  • Idle sleep — the Mac notices you’ve stopped and drifts off on a timer.
  • Lid-close sleep — the sensor trips and the Mac sleeps immediately.

Most keep-awake tools, and the caffeinate command built into macOS, work by holding up a hand and saying “someone is still working here.” That’s an answer to the first kind of sleep. It’s simply not part of the conversation when you close the lid. So the app is doing its job perfectly, the little icon is on, and your Mac goes to sleep anyway.

Nothing is broken, and the app isn’t lying to you. It was built for the other problem.

What actually stops it

There is exactly one setting in macOS that turns off lid-close sleep. It has no window, no checkbox and no menu — it lives in the power-management settings and it takes an administrator to change:

sudo pmset -a disablesleep 1   # lid closed, stays awake
sudo pmset -a disablesleep 0   # back to normal

That’s the whole mechanism. Every method that keeps a Mac awake with the lid shut — ours included — is setting that one flag. There is no second way, and no clever trick anyone is keeping to themselves.

Two things about it are worth knowing before you type it:

  • It needs your administrator password, because it changes how the whole machine behaves, not just one app.
  • It stays on until something turns it off — including across a restart. Set it, forget it, drop the Mac in a bag a week later, and it will happily stay awake in there. That’s the genuine risk of the command-line route: not the command, the forgetting.

If you do keep it awake, do it safely

A closed, awake Mac is fine — people run them that way for years — as long as the heat has somewhere to go:

  • Put it on something hard and flat. Not a bed, not a sofa cushion, not a padded sleeve, and never in a closed bag.
  • Turn the built-in screen off. There’s no reason to light up a display nobody can see, and it’s free heat you don’t need.
  • Stay on power if you can. On battery, a closed Mac runs warmer for less reward, and it’s the one situation where you can’t see the battery draining.
  • Put it back afterwards. Whatever you use, make sure normal sleep returns when you’re done — that’s the safety net, not the feature.

Vertical stands are popular and mostly fine, but they trap more heat than a flat desk does. If your Mac is doing something heavy — a long export, a big backup — flat is kinder.

The version we made

We ran into this at home. My wife works on a large monitor with the MacBook shut beside it, and the trick going round was to balance a book on the keyboard so the lid never quite closed. It worked. It also covered the vents and looked ridiculous.

So we built lidawake: a small menu-bar app that sets that one flag properly. One switch, no Terminal, nothing to paste, and normal sleep comes back the moment you switch it off, quit the app, or if the app stops unexpectedly — so there’s no version of this where you leave it on by accident. It turns the laptop’s own screen off when the lid shuts, watches the temperature, and can stop on its own when the battery gets low.

It’s $6.67 once — not a subscription — with a 14-day free trial, and thewhole thing is open source — the trick above is in this article precisely because it was never the secret. What you’re paying for is that it’s done carefully, signed and notarized by Apple, and it puts your Mac back the way it found it.

Try lidawake free for 14 days →What it does

Related questions

Does closing the lid damage my Mac?

No. Letting it sleep is exactly what it's designed to do, and it's the gentlest thing you can do with a laptop. The care is only needed the other way round — when you keep it awake and running with the lid shut, because then the heat has nowhere to go.

Will my Mac still charge with the lid closed?

Yes. Charging is independent of sleep, and it charges slightly faster asleep because it isn't doing anything else.

Can I keep it awake without an external monitor?

Yes — there's just nothing to look at. It's useful when you want a download, backup, upload, render or export to finish, or music to keep playing to a speaker, and you want the laptop closed and out of the way while it happens.

Why does my Mac wake up on its own with the lid closed?

That's usually not the lid at all. macOS wakes briefly on a schedule to check mail, back up, or install updates, then goes back to sleep. If it's waking constantly, look at what's connected — some USB hubs, docks and mice nudge a Mac awake every time they change state.

I closed the lid and my Mac got hot in my bag. What happened?

Something was holding it awake. That's the failure everyone worries about, and it's the reason to be careful with any method that keeps a Mac awake permanently until you undo it — including the Terminal command below.

Written by zaYco s. r. o., who make lidawake. Last checked August 2026 on macOS 26.