The quickest way to close a 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 program is still running in the background, you may see it reappear when you open it again, or it may continue running tasks you cannot see.
If you want to fully shut down the program instead of just closing its window, use the keyboard shortcut Alt+F4 on Windows and Linux, or Command+Q on Mac. This tells the program to quit entirely, not just hide its window.
Key Takeaways
- The X button closes a window but may leave the program running in the background.
- Alt+F4 (Windows/Linux) or Command+Q (Mac) closes both the window and the program.
- If a window will not close, force-quit the program through Task Manager (Windows), Activity Monitor (Mac), or System Monitor (Linux).
- Unsaved work will be lost when you close a window, so save your files before closing.
The difference between closing a window and quitting a program
When you click the X button, you are closing the window on your screen, but the program itself keeps running. This matters because the program may still be using your computer's memory and processing power. Some programs, like web browsers, are designed to keep running even when all their windows are closed — they may continue downloading files or checking for new messages.
Quitting the program stops it entirely. The program no longer uses your computer's resources, and when you open it again, it starts fresh. If you want to close a window but keep the program running (for example, closing one browser tab while keeping others open), just click the X on that specific window. If you want to stop the program completely, use the keyboard shortcut or go to the File menu and select Quit or Exit.
What to do if a window will not close
Sometimes a window freezes and the X button does not work. On Windows, open Task Manager by pressing Ctrl+Shift+Esc. Find the program name in the list, click it, and then click "End Task" at the bottom right. The window will close immediately, though any unsaved work in that program will be lost.
On Mac, press Command+Option+Esc to open the Force Quit window. Select the program that is not responding and click "Force Quit". On Linux, open System Monitor (search for it in your applications menu), find the program in the Processes tab, right-click it, and select "End Process" or "Kill Process".
Force-quitting should only be your last resort, because it closes the program without letting it save your work or clean up properly. If a program freezes regularly, restart your computer after force-quitting it to make sure everything is working correctly.
Saving your work before closing
When you close a window that contains unsaved work — a document you were editing, an email you were writing, a form you were filling out — that work is usually lost. Most programs will show you a warning dialog asking if you want to save before closing, but not all do.
Get in the habit of saving your work before closing any window. Use Ctrl+S (Windows and Linux) or Command+S (Mac) to save. If you close a window and see a dialog asking "Do you want to save changes?", click "Save" or "Yes" to keep your work. If you click "Don't Save" or "No", the changes disappear.
Closing multiple windows at once
If you have many windows open from the same program and want to close them all, use the keyboard shortcut instead of clicking each X individually. Alt+F4 on Windows and Linux, or Command+Q on Mac, will close every window belonging to that program and quit it entirely.
If you want to close multiple windows but keep the program running, you will need to click the X on each window separately. Some programs, like web browsers, let you close multiple tabs at once by right-clicking a tab and selecting "Close Other Tabs" or similar, but this varies by program.
Why windows sometimes reappear after closing
You close a window, but the next time you open the program, that same window comes back. This happens because some programs are designed to remember which windows were open when you last used them. When you restart the program, it reopens those windows automatically.
To prevent this, quit the program properly (using Alt+F4, Command+Q, or the File menu) instead of just closing the window. Some programs also have a setting in their preferences or options menu to control whether they remember open windows. If a program consistently reopens windows you do not want, check its settings for an option like "Restore previous windows" or "Remember open windows" and turn it off.
Closing windows without using the mouse
If your mouse is not working or you prefer keyboard shortcuts, you can close windows entirely from the keyboard. Alt+F4 (Windows and Linux) or Command+Q (Mac) closes the active window and quits the program. If you want to close just one tab in a web browser without quitting the whole program, use Ctrl+W (Windows and Linux) or Command+W (Mac).
These keyboard shortcuts work in almost every program on your computer. They are faster than moving your mouse to the X button, especially if you close windows frequently.
Frequently Asked Questions
Does closing a window delete the program from my computer?
No. Closing a window only hides it from view or stops that particular program from running. The program files remain on your computer and can be opened again anytime. To remove a program entirely, you need to uninstall it through your system settings.
What happens to my work if I close a window without saving?
Your unsaved work is lost. Most programs warn you before closing if you have unsaved changes, but not all do. Always save your work using Ctrl+S or Command+S before closing a window that contains a document or form.
Can I undo closing a window?
Once a window is closed, you cannot undo it. However, if the program is still running, you can often reopen the window by going to the File menu and selecting "New Window" or by using a keyboard shortcut like Ctrl+N. If you closed unsaved work, that specific content cannot be recovered.
Why does my computer slow down if I do not close windows?
Each open window uses memory and processing power. If you have many windows open from different programs, your computer has less resources available for other tasks, which can make everything run slower. Closing windows you are not using frees up these resources.
Is it better to close windows or just minimize them?
Minimizing a window hides it but leaves the program running and using resources. Closing the window (or quitting the program) frees up memory. If you need the program again soon, minimizing is fine. If you are done with it, closing or quitting saves resources.