Close a window on a Mac
Command-W closes the front window and does not quit the app. Closing every window at once, closing one that is frozen, and closing with no mouse at all.
By Chethan Kumar S N · Updated
Closing a window should be the simplest thing on a Mac, and most days it is. The confusion starts when you expect it to behave like Windows, where the red X on the last window often means the app is about to be gone. On a Mac it means the window is gone and the app is still there, sitting in the Dock with a dot under it, waiting for you to give it something else to do.
Everything else on this page follows from that one difference, so it is worth two sentences of your time before the shortcuts.
Closing one window
| What you do | Where it is | Notes |
|---|---|---|
| Click the red button | Top left corner of the window | Apple calls it the Close button and gives it as the first option |
| Press Command-W | Anywhere in the window | Closes the front window, the one whose traffic lights are coloured in |
| Choose Close Window from the File menu | The menu bar | The shortcut Command-W is printed beside it in almost every app |
The red button is the leftmost of the three circles at the top left, and it only looks solid when the window has focus. Click another window and the front one’s buttons go grey, which is a signal about focus, not about whether you are allowed to close it.
The one place the button is not where you expect is full screen. Full screen hides the menu bar and the Dock, and it takes the three window buttons off the top of the screen with them. Move the pointer to the very top edge and they return.
Closing every window of an app at once
Press Option-Command-W. Apple gives it as the companion to Command-W in the same line, and it is the whole app’s worth of windows in one press.
There is a pattern in Apple’s shortcut list that makes the rest of it easy to remember. Option is the word all. Command-W closes a window and Option-Command-W closes every window the app has open. Command-M minimises a window and Option-Command-M minimises all of them. Command-H hides the app you are in and Option-Command-H hides every other app. Once you have seen that, the list stops being a list of keys and becomes one rule with three uses.
Two things happen after Option-Command-W that surprise people. The app is still running, and the moment you open or create a window the app comes back to life exactly as you left it, because nothing was thrown away. The other is that in an app that uses tabs, the front tab is what the keys act on. Apple documents a per tab route as well: hover over the tab you want to keep and Option-click its Close button, and every other tab in that window closes.
If you would rather keep the windows than close them, tabs are the way out, and macOS will do the collecting for you: Window > Merge All Windows gathers an app’s open windows into one window with a tab each. Merging an app’s windows on a Mac covers that side of it, along with the settings that decide whether a new document opens as a tab in the first place.
Close, quit, hide, minimise
Four words, four different keys, four different places for your window to end up. This is the table worth keeping, and every line in it is from Apple’s own keyboard list.
| What you press | What it does | Where the window is afterwards |
|---|---|---|
| Command-W | Close the front window | Gone, with the app still running |
| Option-Command-W | Close every window of the front app | Same, and the app still shows a dot in the Dock |
| Command-Q | Quit the current app | Gone, along with every window it had |
| Command-H | Hide the windows of the front app | Still on the desktop, just not drawn |
| Option-Command-H | Hide every other app, leaving the front one | Still on the desktop |
| Command-M | Minimise the front window | In the Dock |
The difference that matters is what you can get back. Hiding and minimising are reversible with a click, and everything is exactly where you left it. A closed window is not in the same category, though it is usually one click away on the app’s Dock icon, and that route has its own page: how to reopen a closed window on a Mac. Closing is also why macOS makes you answer a question first when there is unsaved work: a small sheet slides down over the window with Save, Don’t Save and Cancel, and the window will not go until you pick one. That sheet is easy to miss on a busy screen because it belongs to the window rather than to the middle of the display.
If your actual intention was “I want this window out of the way for a minute”, minimising or hiding is the better tool and both are one keypress. If your intention was “I am done with this document”, closing is right. Choosing the wrong one is how people end up with six windows in the Dock and an afternoon of hunting.
When the window will not close
A window whose app has stopped responding will not close, because closing is a request the app answers, and an app that has stopped answering cannot agree to anything. The red button clicks and nothing happens, which is the tell.
The route out is Force Quit. Choose Force Quit from the Apple menu, or press Option-Command-Escape, click the app in the list that appears and click Force Quit. Apple’s warning is worth reading twice: you may lose unsaved changes. Force Quit ends the whole app rather than the window, so every window it had open goes with it, and anything you had not saved is gone rather than recoverable from a prompt.
Two things to try first, both cheaper than losing work. If the app is only slow, leave it alone for a minute; a spinning pointer is often a large file or a stuck network request rather than a dead app, and it will come back. And check that the wait is not a dialog you cannot see: a save sheet or a permissions prompt sitting behind another window makes an app look frozen when it is actually asking you a question. Clicking the app’s Dock icon brings its windows and any dialogs to the front.
Closing with no mouse
The keyboard does all of it, and not only the obvious part.
Command-W closes the window you are looking at. To make sure the window you are looking at is the right one, Command-Grave accent moves to the next open window of the front app, and Shift-Command-Grave accent moves to the previous one. That pair is the missing piece for anyone who has three documents open in one app and a keyboard and no patience.
To reach the menu command itself, Fn-Control-F2 puts focus on the menu bar. Apple describes what happens next exactly: use the arrow keys to move around, press Return to choose an item, or type the item’s name to jump straight to it. So Fn-Control-F2, then close, then Return does what clicking File and Close Window does. The same keys get you to Quit if that is what you meant.
If you would rather tab around the interface than type menu names, turn on Full Keyboard Access in System Settings under Accessibility, then Keyboard. With it on, Tab and Shift-Tab walk between controls, Control-Tab and Control-Shift-Tab move between groups, and Tab-W opens the Window Chooser so you can pick a window out of a list instead of finding it on screen. Control-F7 changes the way Tab moves focus, between all the controls on screen and only the text boxes, which is the setting to reach for when Tab refuses to land on a button. Apple keeps the whole command list behind Tab-H once the feature is on.
Two more worth knowing while you are in there. Fn-Control-F3 moves focus to the Dock, where the arrow keys walk icon to icon and Return opens what you land on. And Control-Up Arrow opens Mission Control, which lays every window on the display out flat so you can arrow to one and press Return to bring it forward. Both beat aiming at a twelve pixel circle.
What closing does to the rest of your windows
Close a window in the middle of a crowded screen and the gap stays there. macOS has no idea the space is now wasted, so you are left with a hole the width of a window and one more thing to tidy by hand.
That is not a small annoyance, it is the same complaint people have about every part of macOS window handling: the system moves windows when you ask and then stops paying attention. Closing does the opposite of what a tidy desk does, because it removes a window without giving the room back.
Every window manager on the Mac is partly an answer to that, and it is worth knowing where each one puts the window when it is not closing it. The grid-shaped ones keep every window on screen at a reduced size so nothing has to leave. The strip-shaped ones keep every window at full size and move the screen instead, which is what Ribbon does: windows sit in a column on a strip that runs past the edges of the display, each display gets its own strip, and nothing shrinks or hides for the next window to become usable.
Closing behaves the way you would hope in a strip, for a boring and honest reason. When a window really is closed, macOS tells the app, and the column is removed and the strip closes up around the gap, so the neighbour you were reading slides in rather than a hole appearing. Hiding with Command-H or minimising with Command-M is treated differently on purpose: those windows keep their slot and come back to it at full size, in the same order, however long you leave them. So the strip holds the line between “parked” and “finished”, which is exactly the distinction this page has been about.
Control-Option and the arrow keys walk along the strip, Control-Option-1 to 9 jump straight to a column, Control-Option-R cycles a column through a third, a half and two thirds, and Control-Option-T floats a window that should not be in the strip at all. If what you actually need is to see two windows at once rather than close one of them, how to organize windows on a Mac is the wider view, and how to minimize a window on a Mac is the other half of the park-it-for-now question.
$15 once for up to 3 Macs, with a full refund within 10 days. It runs on macOS 14 Sonoma or later on Apple silicon and Intel Macs. Try the strip in your browser, or see how it compares with Mission Control and Stage Manager.
Questions
What is the shortcut to close a window on a Mac?
Command-W closes the front window. Apple's own line is short and complete: Command-W closes the front window, and to close all windows of the app you press Option-Command-W. If the window is in full screen, the green button is the way out instead, and Control-Command-F does the same thing in the apps that support it. There is no separate key for the red button, because the red button is exactly what Command-W does.
Does closing a window quit the app on a Mac?
No, and this is the single most useful thing to know about closing on a Mac. Apple states it plainly: closing one or all windows for an app doesn't quit the app, it remains open, shown by the small dot below its icon in the Dock. The app is still running, still holding memory, still able to reopen a window instantly. To end it, press Command-Q, or choose Quit from the menu named after the app. On macOS a window and an app are two different things, which is why your Dock fills up with dots long before it fills up with windows.
How do I close a window on a Mac that is not responding?
Force Quit, because a stuck app will not answer the close button either. Choose Force Quit from the Apple menu, or press Option-Command-Escape, click the app in the list and click Force Quit. Apple warns that you may lose unsaved changes, and it quits the whole app rather than the one window, so every window that app has open goes with it. If you only need the window gone and the app is still working normally, Command-W is the gentler answer and it lets the app ask you about unsaved work first.
How do I close a window on a Mac without using the mouse?
Command-W closes the window you are looking at, and Command-Grave accent moves between the windows of the front app so you can walk to the one you want. To reach the close command itself, press Fn-Control-F2 to put focus on the menu bar, then type close and press Return, which is Apple's own documented way of reaching a menu item by name. If you would rather navigate the interface, turn on Full Keyboard Access in System Settings under Accessibility, Keyboard, and Tab-W opens the Window Chooser so you can pick a window and then close it with Command-W.
Why is the red close button greyed out or missing?
Usually because the window is full screen and the menu bar is hidden, so the three buttons are off the top of the screen rather than gone. Move the pointer to the very top edge and they come back, or press Control-Command-F to leave full screen altogether. A button that is truly greyed out means the app has decided that window cannot be closed that way, which is normal for some settings windows and setup assistants, and the way out there is the app's own Done or Cancel button. Quitting the app with Command-Q still works when the window itself refuses.
Ready? Buy Ribbon for $15, or read all the guides.