The simplest way to close a window

To close a window, look for the X button in the top right corner of the window (on Windows) or top left corner (on Mac). Click it once. The window closes and the program usually stays running in the background unless it was the last window open.

If you cannot see the X button, the window may be maximized — taking up your entire screen. Move your mouse to the very top of the screen where the title bar should be. You will see the X button there.

Closing a window is different from closing a program. When you close a window, you are shutting down that single view into the program. The program itself may still be running, and you can open a new window from it later. This matters because unsaved work in that window may be lost.

Key Takeaways

  • The X button closes a single window, not the entire program — the program keeps running unless it was the only window open.
  • On Windows, the X button is in the top right corner; on Mac, it is in the top left corner.
  • If a program asks "Do you want to save changes?" before closing, you have the chance to save your work before the window shuts.
  • You can also close a window by pressing Alt+F4 on Windows or Command+W on Mac, which is faster once you know the shortcut.

What happens when you close a window

When you click the X button, the window disappears from your screen. If the program has other windows open, those stay visible. If that was the only window for that program, the program itself closes and stops running.

Before the window closes, the program may ask you to save your work. A dialog box appears with buttons like "Save," "Don't Save," and "Cancel." If you click "Save," your document is written to disk. If you click "Don't Save," any changes you made since the last save are thrown away. If you click "Cancel," the close action stops and you return to your work.

This safety step exists because closing a window without saving means you lose everything you typed, edited, or changed since you last saved. Most programs default to asking you, but some programs auto-save and may not ask at all.

Using keyboard shortcuts to close windows

If you prefer not to use the mouse, you can close a window with a keyboard shortcut. On Windows, press Alt+F4. On Mac, press Command+W. Both shortcuts close the active window — the one you are currently working in.

These shortcuts work the same way as clicking the X button. If the program has unsaved changes, it will ask you to save before closing. If you want to close the entire program instead of just one window, the shortcuts still work — they close the active window, and if it is the last one, the program closes too.

Learning these shortcuts saves time if you work with many windows. You do not have to move your mouse to the corner of the screen; you just press two keys at once.

When a window will not close

Sometimes clicking the X button does nothing, or the window closes and when ready reopens. This usually means the program is frozen or stuck on a task it cannot finish.

On Windows, open the Task Manager by pressing Ctrl+Shift+Esc. Find the program name in the list, click it, and click "End Task." The program stops when ready and all its windows close. On Mac, press Command+Option+Esc, select the program, and click "Force Quit."

Force quitting closes the program without saving, so you will lose any unsaved work. Use it only when the normal close button does not work. After you force quit, restart the program and see if it works normally. If the same program keeps freezing, it may have a problem that needs troubleshooting or reinstalling.

The difference between closing and minimizing

Closing a window and minimizing a window are not the same thing. When you close a window, it disappears completely. When you minimize a window, it hides but the program keeps running, and you can bring it back by clicking its icon in the taskbar (Windows) or dock (Mac).

The minimize button is usually to the left of the X button. On Windows, it looks like a dash or line. On Mac, it looks like a yellow dot. Clicking it shrinks the window out of sight but does not close it. The program is still using memory and still running in the background.

If you want to stop a program from running entirely, close all its windows. If you just want it out of the way for now, minimize it instead.

Closing multiple windows at once

If a program has many windows open and you want to close them all, you can close the program itself instead of closing each window one by one. Right-click the program's icon in the taskbar (Windows) or dock (Mac) and select "Close all windows" or "Quit." The program stops running and all its windows close at once.

If you have unsaved work in any of those windows, the program will usually ask you to save before closing. Some programs ask for each window; others ask once for all unsaved changes. Pay attention to these prompts so you do not lose work by accident.

Another way to close a program entirely is to use Alt+F4 on Windows when the program is active. This closes the program, not just the current window, if it is the last window open. On Mac, you can press Command+Q to quit the program entirely.

Frequently Asked Questions

What is the difference between closing a window and closing a program?

Closing a window shuts down one view into the program. The program keeps running unless that was its only window. Closing a program stops it entirely. You close a program by closing its last window, or by right-clicking its icon and selecting Quit or Close.

Will I lose my work if I close a window?

Only if you have not saved it. When you close a window with unsaved changes, the program asks "Do you want to save changes?" before closing. Click "Save" to keep your work, or "Don't Save" to throw it away. If you click "Cancel," the close action stops and you stay in the window.

Why does a window close and then reopen by itself?

The program is usually frozen or stuck. Try closing it again and waiting a few seconds. If it keeps reopening, force quit it using Task Manager (Windows) or Force Quit (Mac). Then restart the program. If the problem happens again, the program may need to be reinstalled.

Can I close a window without using the mouse?

Yes. On Windows, press Alt+F4 to close the active window. On Mac, press Command+W. Both shortcuts work the same way as clicking the X button and will ask you to save unsaved work before closing.

What does minimizing a window do?

Minimizing hides the window from your screen but keeps the program running. Click the minimize button (a dash on Windows, a yellow dot on Mac) to hide the window. Click the program's icon in the taskbar or dock to bring it back. The program is still using memory and running in the background.