How to Close a Window on Any Computer or Device

Closing a window sounds like the simplest thing in the world — until you're using an unfamiliar operating system, a touchscreen device, or a keyboard-only setup and suddenly the obvious method isn't available. Here's a complete breakdown of every reliable way to close a window, across every major platform.

Why There Are So Many Ways to Close a Window

Modern operating systems are designed around multiple input methods — mouse, keyboard, touchpad, touchscreen, and voice — so each one offers several parallel paths to the same result. Knowing more than one method means you're never stuck, even when your primary input device isn't cooperating.

It's also worth distinguishing between closing a window and quitting an application. On Windows and Linux, closing the last open window of a program usually quits it entirely. On macOS, closing a window often leaves the app running in the background — a meaningful difference if you're managing memory or battery life.

How to Close a Window on Windows

Method 1: The X Button The most familiar approach. Every standard window has a red × button in the top-right corner. Click it once to close the active window.

Method 2: Keyboard Shortcut Press Alt + F4 to close the currently active window. This works across virtually all Windows versions and applications. If no window is active, it may trigger a shutdown dialog.

Method 3: Right-Click the Taskbar Right-click the app's icon in the taskbar at the bottom of the screen and select Close window (or Close all windows if multiple instances are open).

Method 4: Keyboard Menu Press Alt + Spacebar to open the window's system menu, then press C for Close. Useful when a window is frozen or partially off-screen.

Method 5: Task Manager For unresponsive windows, press Ctrl + Shift + Esc to open Task Manager, find the application, and click End Task. This force-closes the window without waiting for the program to respond.

How to Close a Window on macOS

Method 1: The Red Circle Button On Mac, the close button is a red circle in the top-left corner of every window. Click it to close the window. Note: this does not always quit the application.

Method 2: Keyboard Shortcut Press Command (⌘) + W to close the active window. To quit the application entirely (closing all its windows), use Command + Q.

Method 3: Right-Click in the Dock Right-click or Control-click the app's icon in the Dock and select Quit to close the application and all its windows simultaneously.

Method 4: The Application Menu Every Mac app shows its name in the top-left menu bar. Click the app name, then select Hide, Close Window, or Quit depending on what you need.

How to Close a Window on Linux 🖥️

Linux behavior varies depending on the desktop environment — GNOME, KDE Plasma, XFCE, and others each have slightly different interfaces, but the core methods are consistent.

Method 1: Title Bar Button Most Linux desktop environments display a close button (usually an × or a circle) in the window's title bar. The position — top-left or top-right — depends on the desktop theme.

Method 2: Keyboard ShortcutAlt + F4 works across most Linux desktop environments, just as it does on Windows.

Method 3: Right-Click the Title Bar Right-clicking anywhere on a window's title bar typically reveals a context menu with a Close option.

Method 4: Terminal Command If a window is completely frozen, open a terminal and use the xkill command — your cursor becomes a kill cursor, and clicking on any window forces it closed.

How to Close a Window on Chromebook

Press Alt + F4 or click the × button in the top-right corner of any window. ChromeOS also supports closing tabs within the Chrome browser using Ctrl + W, which is worth knowing since most Chromebook activity happens inside the browser.

Closing Browser Windows vs. Application Windows

There's an important distinction between browser tabs and browser windows:

ActionShortcut (Windows/Linux)Shortcut (macOS)
Close current tabCtrl + WCommand + W
Close entire browser windowAlt + F4Command + W (last tab)
Reopen closed tabCtrl + Shift + TCommand + Shift + T

Pressing Ctrl + W (or Command + W) inside a browser closes the active tab, not necessarily the entire window — unless it's the last tab remaining.

When a Window Won't Close 🚫

Sometimes a window becomes unresponsive and ignores the close button entirely. In those cases:

  • Windows: Use Ctrl + Shift + Esc → Task Manager → End Task
  • macOS: Use Command + Option + Escape → Force Quit → select the app
  • Linux: Use xkill in the terminal or the system monitor equivalent
  • All platforms: If the entire system is frozen, a hard restart (holding the power button) is the last resort — though unsaved work will be lost

Variables That Affect Which Method Works Best

Not every method works equally well in every situation. The right approach depends on:

  • Input device available — keyboard shortcuts become essential when a mouse or touchpad fails
  • Operating system and version — macOS's app-stays-open behavior surprises many Windows users switching platforms
  • Application type — some full-screen apps, games, and kiosk-mode applications suppress the standard close button entirely, requiring keyboard shortcuts or Task Manager
  • Whether the window is responsive — a frozen window needs a force-close method, not the standard × button
  • Desktop environment on Linux — keyboard shortcuts and button placement vary across GNOME, KDE, XFCE, and others

A user on a standard Windows desktop with a working mouse rarely needs to think about any of this. But a user on macOS switching from Windows, or someone troubleshooting a frozen application, or someone working on a Linux machine with an unfamiliar desktop environment — each of those situations calls for a different approach, and the "obvious" method may not be the right one for where they're actually working.