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.
Apple’s MacBook Pro guide describes it in one sentence: when you have an external display and accessories (like a keyboard and mouse) connected to your MacBook Pro, you can keep working even when the lid is closed. (Apple’s guide is here.)
That is all the guide says about it. It names the display and the accessories, and nothing else — it says nothing about power, about the Mac going to sleep, or about waking it with a key.
So we measured it, on one MacBook with the lid shut, an external display attached and lidawake not running. Plugged in, it stayed awake for 12 minutes with no sleep recorded. On battery, macOS put it to sleep.
If you work with a display, keyboard and mouse connected, start with that — you may not need extra software, ours included. Read on if it isn’t enough.
Why clamshell mode isn’t enough for a lot of people
It falls short in two common ways:
- You’re on battery. Unplug, close the lid, and it sleeps, even with the external display attached. 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.
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.
Which tools say they work with the lid closed, checked against each tool’s own page → Keep a Mac awake with the lid closed: apps compared
What actually stops it
Without an external display, the free way is a single setting in macOS. 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 normalThat’s the free way to do it without an external display, and it is the flag lidawake sets too — and puts back. Some apps describe other mechanisms on their own pages, such as power assertions; we make no claim here about whether those keep a Mac awake with the lid shut.
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 — and, more to the point, unsets it. One click to turn it on. After that the laptop’s own screen goes dark, and lidawake watches heat and battery. Normal sleep also comes back if you quit, if the app crashes, or if it freezes — the helper restores it on its own authority. By default it also switches off when you unplug; if you’ve let it run on battery instead, it plays a sound when you close the lid with nothing plugged in, so a switch you forgot about gets noticed before the bag does.
It’s $19 once for one Mac, or $29 for three — not a subscription — with a 14-day free trial, a 14-day money-back guarantee, and the whole thing is open source — the trick above is in this article precisely because it was never the secret. What you’re paying for is the part that runs when you’re not watching: the guards, the automatic stop, and a helper that puts your Mac back the way it found it even if the app is gone. It’s signed and notarized by Apple, so it just runs.
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. It's also the specific thing lidawake is built to prevent: by default, unplugging your Mac switches lidawake off. It also steps back if the Mac starts running hot, its helper restores normal sleep even if the app crashes, and if you've let it run on battery, it plays a sound the moment you close the lid with nothing plugged in.
Written by zaYco s. r. o., who make lidawake. Last checked August 2026 on macOS 26.