The fastest way to close a window on a Mac

The red circle in the top-left corner of any window closes it. Click that red dot and the window shuts. That's the main method most people use, and it works the same way whether you're closing Safari, Mail, a document, or any other program.

You can also use the keyboard shortcut Command + W to close the active window — the one you're currently looking at. If you have multiple windows open in the same program, Command + W closes one at a time, starting with whichever window is in front.

A third option is to right-click (or Control-click) the program's icon in the Dock at the bottom of your screen and select "Close All Windows" from the menu that appears. This closes every window that program has open at once.

Key Takeaways

  • Click the red circle button in the top-left corner of any window to close it immediately.
  • Press Command + W on your keyboard to close the window you're currently using without touching the mouse.
  • Right-click a program's Dock icon and choose "Close All Windows" to shut down multiple windows in that program at once.
  • Closing a window does not quit the program — the program keeps running in the background unless you quit it separately.
  • If a document has unsaved changes, macOS will ask you to save before closing the window.

The difference between closing a window and quitting a program

Closing a window and quitting a program are two separate actions on a Mac. When you close a window, the program itself keeps running. You might close your Safari window but Safari is still open — you just can't see it on your screen anymore.

To actually quit a program and stop it from running, you use Command + Q or right-click the Dock icon and select "Quit". This closes all windows in that program and stops it from using your computer's memory and processing power.

This distinction matters if you're trying to free up your Mac's resources or if you want to make sure a program isn't running in the background. Closing windows alone won't do that.

What happens if you close a window with unsaved work

If you close a window that contains a document with unsaved changes, macOS stops you and shows a dialog box. The box asks whether you want to save the changes, discard them, or cancel the close action.

Click "Save" to keep your changes before closing. Click "Don't Save" to close without saving — you'll lose any changes you made since the last save. Click "Cancel" to go back to the window without closing it.

This safety feature prevents you from accidentally losing work. Some programs, like Google Docs or Dropbox Paper, save automatically as you type, so you may never see this dialog.

Closing windows using the keyboard and trackpad

If you prefer not to use the mouse, Command + W is the fastest keyboard method. Press and hold Command, then tap W, and the active window closes.

On a trackpad, you can also use a three-finger swipe up from the bottom of the trackpad to close the window, though this requires enabling the gesture in System Settings first. Go to System Settings > Trackpad > More Gestures and turn on "Swipe up with three fingers".

For people who use their Mac primarily with a trackpad rather than a mouse, these keyboard and gesture options can be faster than reaching for the red button.

Closing multiple windows at once

If you have several windows open in one program and want to close them all, right-click the program's icon in the Dock and select "Close All Windows". This shuts every window that program has open without quitting the program itself.

If you want to close windows across different programs, you'll need to close them one by one or quit each program. There's no single command to close all windows on your Mac at once.

Be aware that closing all windows in a program that has unsaved documents will trigger the save dialog for each document. If you have five open documents with changes, you'll see five save prompts.

When a window won't close

Occasionally a window becomes unresponsive and won't close when you click the red button or press Command + W. This usually means the program has frozen or is processing something that's taking a long time.

Try waiting a few seconds — sometimes a program just needs time to finish what it's doing. If the window still won't close, you can force-quit the program. Press Command + Option + Escape, select the program from the list that appears, and click "Force Quit".

Force-quitting closes the program and all its windows immediately, but any unsaved work in that program will be lost. Use it only when a window is truly stuck.

Frequently Asked Questions

Does closing a window delete the file?

No. Closing a window just hides it from view. The file itself stays on your Mac. If you saved the file before closing, it's still there and you can open it again later. If you didn't save, the unsaved changes are lost, but the file itself isn't deleted.

Can I undo closing a window?

Not directly. Once a window is closed, it's closed. However, if you closed a document without saving and want to recover it, some programs like Word or Pages let you reopen recent documents. You can also check the Trash to see if you accidentally deleted the file itself.

What's the difference between the red, yellow, and green buttons?

The red button closes the window. The yellow button minimizes the window, hiding it from view but keeping the program running — click the Dock icon to bring it back. The green button maximizes the window to fill your screen, though on modern Macs it usually enters full-screen mode instead.

Why does my Mac show a dialog when I try to close a window?

The dialog appears because the document in that window has changes you haven't saved yet. macOS is asking whether you want to keep those changes or discard them before closing. This prevents accidental data loss.