How to Close a Tab on a Mac With the Keyboard: And What Closes With It

Closing a tab on a Mac with the keyboard is Command-W. That answer takes four seconds to find, which means almost nobody searches for it cold. The search happens after something went wrong: Command-W took the whole window, Ctrl-W did nothing at all, or one press removed a form that had been half filled in for twenty minutes.

The useful version of this answer is therefore not the key itself but the blast radius. What follows states what Apple and Google document for their own browsers as of 26 September 2026, what the neighbouring keys do, and how to recover from each of the two mistakes people actually make.

Command-W, and the two things it is documented to mean

Apple's general keyboard shortcut reference describes Command-W as closing the front window. Apple's Safari reference describes Command-W as closing the active tab. Google's Chrome reference describes it as closing the current tab or pop-up.

Those three descriptions are not in conflict. The key is bound to the nearest closeable thing, and in a browser with several tabs open that is the tab. The ambiguity only appears at the edge, when one tab is left, and there the behaviour is a decision each app makes for itself.

The File menu is the source of truth, and it updates live. Open it with several tabs open and the item reads Close Tab. Open it with one tab left and it reads Close Window in some apps and still Close Tab in others. Two seconds of looking answers the question for the specific app in front of you, permanently, in a way no general article can.

That distinction is worth caring about because the recovery is different in each case. A closed tab and a closed window are separate items in a browser's history of what it just discarded, and the shortcut that brings one back does not always bring back the other.

Why Ctrl-W does nothing

This is the second most common version of the search, and the answer is structural rather than a setting.

On a Mac, Command is the modifier that issues application commands. Apple states the substitution directly for people coming from a PC keyboard: press Alt instead of Option, and press either Ctrl or the Windows logo key instead of Command. Read in the other direction, that sentence explains the whole problem. Ctrl-W is the Windows shortcut. Command-W is its Mac equivalent. They are the same command wearing a different modifier.

Control on a Mac is doing something else entirely. It carries a set of text editing bindings inherited from terminal conventions, documented by Apple as part of the text editing shortcuts. Control-H deletes the character to the left of the insertion point. Control-D deletes the character to the right. Control-K cuts from the insertion point to the end of the paragraph. Control-A moves to the beginning of a line and Control-E to the end.

The practical consequence for anyone switching platforms is that Control based muscle memory will not merely fail on a Mac, it will occasionally do something unexpected in a text field. The fix is not remapping. It is accepting that Command is where application commands live.

The keys either side of Command-W

Everything in this table is documented by Apple for Safari and macOS, or by Google for Chrome.

Shortcut Safari Chrome
Command-W Close the active tab Close the current tab or pop-up
Shift-Command-W Close the window and its tabs Close the current window
Option-Command-W Close all windows of the app Not documented
Command-Q Quit the app Quit Chrome
Shift-Command-T Reopen the last closed tab Reopen closed tabs in the order they were closed
Command-T Open a new tab Open a new tab and jump to it
Option-click a tab Close all tabs except that one Not documented
Control-Tab, or Shift-Command-] Next tab Command-Option-Right Arrow
Control-Shift-Tab, or Shift-Command-[ Previous tab Command-Option-Left Arrow
Command-1 to Command-8 First eight tabs First eight tabs
Command-9 Last tab Last tab

Three rows deserve attention.

Option-clicking a tab in Safari closes every other tab and leaves that one open. It is the fastest route out of a window that has grown past usefulness, and it is a mouse action rather than a shortcut, which is presumably why so few people know it exists.

Command-Q is the row to be careful about. It sits one key away from Command-W on a standard layout, it quits the entire browser, and it does not ask. Anyone who has lost a window full of tabs to a slipped finger has found this key.

The next and previous tab shortcuts differ between the two browsers, which is the single most common cause of a shortcut that works at home and not at work. Safari uses Control-Tab. Chrome documents Command-Option and an arrow key. Both accept the bracket variants, so Shift-Command-] and Shift-Command-[ are the pair worth learning if both browsers are in daily use.

The Finder has tabs too, and the keys mean something else

Anyone who has learned tab shortcuts in a browser and then tried them in the Finder has met the most confusing overlap in the whole set. The Finder supports tabs, the same modifier is involved, and two of the bindings mean something entirely different.

Apple documents Command-T in the Finder as showing or hiding the tab bar when a single tab is open in the current window, and Shift-Command-T as showing or hiding the tab bar in Finder windows. Neither opens a tab and neither reopens a closed one. In a browser, those same two combinations open a new tab and recover a closed one.

Shortcut In Safari or Chrome In the Finder
Command-T Open a new tab Show or hide the tab bar with one tab open
Shift-Command-T Reopen a closed tab Show or hide the tab bar
Command-W Close the active tab Close the front window
Option-Command-T Not documented Show or hide the toolbar with one tab open

The lesson is that tab shortcuts belong to the app, not to macOS. Only Command-W is close to universal, because it is a window command that browsers reinterpret as a tab command when a tab is the nearer thing to close.

That is also why advice copied between apps produces so much confusion in this area. A shortcut list for one browser is a list for that browser. The reliable habit is to check the File menu of whatever app is in front, which shows the real binding and updates as the context changes.

Getting a tab back

Shift-Command-T is the key to commit to memory, and it is more capable than most people assume.

In Chrome, Google documents it as reopening previously closed tabs in the order they were closed, which means pressing it repeatedly walks backwards through the session rather than only recovering the most recent loss.

In Safari, Apple documents Shift-Command-T under two separate headings. Under Tabs it reopens the last tab that was closed. Under Window it reopens the last window that was closed. One shortcut covers both the small mistake and the large one.

Two limits are worth knowing before relying on it. Recovery restores the page, not the state of the page, so text typed into a form and never submitted is usually gone even though the tab comes back. And it is session bound, so a browser that was quit and reopened has a different and shorter memory of what was closed.

For work that must not be lost, the honest advice is not a better recovery shortcut. It is to stop keeping that work in something a single keypress can dismiss.

When Command-W is not the right key at all

Three situations break the assumption, and all three are worth recognising rather than fighting.

Some apps do not bind it. A Mac app that has no concept of a closeable tab will use Command-W for its window or not at all, and web apps running inside a browser can intercept the key for their own purposes, since the page receives the keystroke before the browser acts on it in some configurations. When a shortcut behaves differently in one site than in the rest of the browser, the site is the explanation.

Some apps move it between versions. The File menu again settles the question faster than any search, because it always shows the current binding for the app currently in front.

And a binding can be changed deliberately. Apple documents creating custom shortcuts in System Settings, under Keyboard, then Keyboard Shortcuts, then App Shortcuts, where a shortcut is attached to a menu command by typing the command exactly as it appears in the menu. Two constraints apply. Only existing menu commands can be bound, so nothing can be invented that the app does not already offer. And if the combination is already in use by another command, Apple states the new shortcut simply will not work until one of the two is changed, which explains most custom bindings that appear to do nothing.

The tabs that should never have been tabs

Step back from the keyboard for a moment and the shape of the original problem becomes visible. The reason one wrong keypress hurts is that a browser window is holding two entirely different kinds of thing and treating them identically.

Some tabs are disposable. A search result, a documentation page, an article opened and not yet read. Losing one costs nothing, and Command-W exists precisely so they can be discarded quickly.

Other tabs are not tabs in any meaningful sense. A mail client, a team chat, a project tracker, a design tool, a support inbox, a second account on a service already open in another tab. These are the applications the day is spent in. They stay open for weeks. They hold unsent drafts and half finished states. And they sit in the same strip as the disposable ones, at the same size, one Command-W away from being gone, indistinguishable at a glance.

That is a structural problem and no shortcut fixes it. The fix is to stop putting long lived applications in a container designed for throwaway pages. A browser built around apps gives each one its own window and its own cookie container, so two accounts on the same service can stay signed in at the same time and each workspace is reached by name rather than found by shape among thirty near identical favicons. A mail app that lives in its own space is not something a slipped finger closes, because it is not a tab in a row. The feature list is the place to check that against the specific set of apps in question, and anyone who keeps a terminal open beside them all day should look at the built in shell.

What to change first

Learn Shift-Command-T today, because it recovers both a closed tab and a closed window in Safari and walks backwards through closed tabs in Chrome. Then open the File menu in the browser being used and read what Command-W is currently bound to, since that one look answers the last tab question for good. If the tabs worth protecting are the ones you never close, move them out of the tab strip entirely with SpaceDeck.

Frequently asked questions

What is the keyboard shortcut to close a tab on a Mac?

Command-W. Apple documents it as closing the active tab in Safari and Google documents it as closing the current tab in Chrome. With one tab left, whether it closes the tab or the window depends on the app, and the File menu shows which by labelling the item either Close Tab or Close Window.

Why does Ctrl-W not close a tab on a Mac?

Because Command, not Control, is the modifier that issues application commands on a Mac. Apple's own guidance for PC keyboards is to press Ctrl in place of Command, which is the same substitution read in reverse. Control on a Mac carries text editing bindings instead, so Control based combinations may do nothing or something unrelated.

How do you close every tab except one?

In Safari, Option-click the tab you want to keep and the rest close. To close the window and all its tabs at once, use Shift-Command-W in either Safari or Chrome. Option-Command-W closes all windows of the current app, and Command-Q quits the app entirely without asking.

Can a closed tab be reopened with the keyboard?

Yes, with Shift-Command-T. Google documents it as reopening closed tabs in the order they were closed, so repeated presses walk back through the session. Apple documents it in Safari as reopening both the last closed tab and the last closed window. Text typed into a form and never submitted is usually not restored.

Is there a way to stop closing important tabs by accident?

Rebinding is possible through System Settings, Keyboard, Keyboard Shortcuts and App Shortcuts, but only for existing menu commands, and a combination already in use will not work. The more reliable answer is to stop keeping long lived applications in the tab strip, since anything that is not a tab cannot be closed by a key meant for tabs.

Back to all posts