The fastest way to close any window
Click the X button in the top-right corner of the window (on Windows and Linux) or the red circle in the top-left corner (on Mac). That closes the window immediately. If the X button is not visible, the window may be in fullscreen mode — press the Escape key, then try the X button again.
If a window is frozen and the X button does not respond, you can force it closed using your keyboard. On Windows, press Alt + F4. On Mac, press Command + Q (to close the entire application) or Command + W (to close just that window). On Linux, the shortcut depends on your desktop environment, but Alt + F4 works on most systems.
Key Takeaways
- The X button in the corner closes a window — top-right on Windows and Linux, top-left on Mac.
- If a window is frozen, use Alt + F4 on Windows or Linux, or Command + Q on Mac to force it closed.
- Closing a window is different from shutting down your computer — the window closes but your system keeps running.
- If you have unsaved work in the window, the program will usually ask you to save before closing.
What happens when you close a window
Closing a window stops that program from running on your screen, but it does not shut down your computer. Other programs keep working. If you have unsaved work — a document you were editing, a form you were filling out — most programs will show a dialog box asking whether you want to save before closing. Click "Save" to keep your work, or "Don't Save" to discard it.
Some programs, like web browsers, may ask whether you want to save your open tabs or windows so you can reopen them next time. This is optional — you can close without saving and simply reopen the program fresh later.
When the close button does not work
If you click the X button and nothing happens, the window is likely frozen. This means the program has stopped responding to your clicks. The fastest fix is the keyboard shortcut: Alt + F4 on Windows or Linux, or Command + Q on Mac. These force the window closed without waiting for the program to respond.
If the keyboard shortcut does not work either, your system may be completely unresponsive. On Windows, press Ctrl + Alt + Delete, then click "Task Manager" and find the frozen program in the list. Click it once to select it, then click "End Task" at the bottom right. On Mac, press Command + Option + Escape, select the frozen program, and click "Force Quit". On Linux, open a terminal and type killall [program name], replacing [program name] with the name of the frozen program.
Closing windows versus minimizing them
Closing a window is different from minimizing it. When you minimize a window, it disappears from your screen but the program keeps running in the background — you can click the program's icon in your taskbar (Windows and Linux) or dock (Mac) to bring it back. When you close a window, the program stops running entirely.
The minimize button is usually next to the X button — on Windows and Linux it looks like a dash or underscore, and on Mac it looks like a yellow circle. If you want to pause what you are doing without closing the program, minimize instead of close.
Closing multiple windows at once
If a program has several windows open and you want to close them all, you can close the entire program instead of closing each window one by one. On Windows and Linux, press Alt + F4 while any window from that program is active. On Mac, press Command + Q. This closes the program and all its windows together.
Some programs, like web browsers, let you close all windows except one. In most browsers, right-click a tab and select "Close Other Tabs" to keep only that one open. This is faster than closing tabs individually.
Closing windows in fullscreen mode
When a program is in fullscreen mode, the close button and menu bar are hidden. Press the Escape key to exit fullscreen and return to normal window mode. Once you see the X button again, you can close the window normally. On some programs, you may need to move your mouse to the top of the screen to make the menu bar appear before you can click the X button.
Video players, games, and presentation software often use fullscreen mode. If you are unsure whether a program is in fullscreen, pressing Escape is safe — it will either exit fullscreen or do nothing, depending on the program.
Frequently Asked Questions
Does closing a window delete my files?
No. Closing a window closes the program, but your files stay on your computer. If you had unsaved work in the program, that work is lost — but the files themselves remain. You can reopen the program and access your files again.
What is the difference between closing and quitting?
Closing a window closes that one window, but the program may still be running with other windows open. Quitting closes the entire program and all its windows. On Mac, "Quit" is the standard term; on Windows and Linux, it is usually called "Exit" or "Close Application".
Can I undo closing a window?
Once a window is closed, you cannot undo it. However, many programs (especially web browsers) let you reopen recently closed windows. In most browsers, press Ctrl + Shift + T on Windows and Linux, or Command + Shift + T on Mac, to reopen the last closed tab or window.
Why does my computer ask me to save when I close?
The program is warning you that you have made changes that have not been saved to a file. If you click "Don't Save", those changes are lost forever. Click "Save" to keep them, or "Cancel" to go back to the window without closing it.