Close Tab Shortcut Mac: The 2 Keys That Work Everywhere

How-to basics · Updated November 23, 2026

The fastest way to close a tab on a Mac is Command-W (⌘W) — it works in Safari, Chrome, Firefox, Finder, and most other apps. If you want to close the entire window instead of just one tab, press Command-Shift-W (⌘⇧W) in most browsers.

Why ⌘W Is the Universal Close Command

Apple has used ⌘W as the standard “Close” shortcut since the original Macintosh. It maps to the File > Close menu item in nearly every application. Because it is built into the macOS menu system rather than a specific app, it works consistently across browsers, text editors, PDF viewers, and even system dialogs. When you press ⌘W in a browser with multiple tabs open, it closes the active tab. When only one tab remains, ⌘W closes the entire window in most browsers — except Safari, which keeps the window open with a blank “Start Page” tab.

How the Shortcut Behaves in Each Major Browser

  • Safari: ⌘W closes the current tab; with one tab, it leaves an empty window. ⌘⇧W closes the whole window.
  • Chrome: ⌘W closes the current tab; with one tab, it closes the window. ⌘⇧W closes the window immediately.
  • Firefox: Same as Chrome — ⌘W closes the tab, and if it’s the last tab, the window closes.
  • Edge: Identical to Chrome, since it’s Chromium-based.
  • Opera: Also Chromium-based, so ⌘W works the same way.

If you close a tab by accident, press Command-Shift-T (⌘⇧T) to reopen it. This works in Safari, Chrome, Firefox, and Edge, and it restores the tab in its original position.

Closing Tabs Without the Keyboard

If you prefer the mouse or trackpad, there are several options. On a MacBook, you can often close a tab by hovering over it and clicking the small “x” that appears. In Safari, the close button shows only when you hover over the tab. In Chrome and Firefox, the “x” is always visible on the active tab. You can also right-click (or Control-click) a tab to see a context menu with “Close Tab” and “Close Other Tabs” options. For a faster workflow, you can use a three-finger swipe on the trackpad to switch tabs, but that doesn’t close them — you still need the keyboard or the click.

What About Closing Tabs in Finder or Other Apps?

Finder on macOS also supports tabs (since OS X Mavericks). Press ⌘W to close the current Finder tab, and ⌘⇧W to close the entire Finder window. Many other Mac apps that support tabs — like Terminal, TextEdit, and Preview — follow the same pattern. In apps that don’t use tabs, ⌘W closes the document window. For example, in Microsoft Word, ⌘W closes the current document (prompting to save if needed), while ⌘⇧W does nothing special — it’s not a standard shortcut in Word. The key is that ⌘W always means “close the current thing,” whether that thing is a tab, a document, or a window.

Common Problems and Fixes

Sometimes ⌘W doesn’t work as expected. If you’re in a web page with a form or a dialog box, ⌘W might close the dialog instead of the tab. In that case, press Escape first to dismiss the dialog, then try ⌘W again. Another issue: if you’ve remapped your keyboard shortcuts in System Settings > Keyboard > Keyboard Shortcuts, ⌘W might be assigned to something else. Check that list to see if you’ve overridden it. Also, some apps (like Adobe Photoshop) use ⌘W to close a document but not a tab — that’s normal. If ⌘W does nothing at all, the app may be unresponsive; try clicking on the window first to make sure it has focus, then press ⌘W again.

How to Change or Customize the Shortcut

You can change the close-tab shortcut for specific apps in macOS. Go to System Settings > Keyboard > Keyboard Shortcuts > App Shortcuts. Click the “+” button, choose the app (e.g., Safari), type the exact menu title (“Close Tab” — note the capitalization and spacing), and assign a new key combination. This is useful if you want to use something like Control-W instead. However, be careful: if you change ⌘W globally, it will affect all apps that use the standard menu item. For most users, the default ⌘W is fine, but the option exists if you need it for accessibility or personal preference.

Frequently Asked Questions

Does ⌘W close the whole browser window? In Chrome, Firefox, Edge, and Opera, ⌘W closes the window if only one tab is open. In Safari, it leaves an empty window. To force-close the window regardless of tabs, use ⌘⇧W.

How do I close a tab on a MacBook Pro with Touch Bar? The Touch Bar doesn’t have a dedicated close-tab button by default. You can add a “Close Tab” button to the Touch Bar via System Settings > Keyboard > Customize Control Strip, but it’s easier to just press ⌘W or click the tab’s “x”.

Why does ⌘W sometimes close the whole app instead of just a tab? That happens when the app doesn’t support tabs at all — for example, in a utility app like Calculator, ⌘W closes the window, and if it’s the only window, the app quits. In browsers, this only occurs when you’re down to the last tab and you’re not using Safari.

Is there a way to close all tabs at once? Yes. In most browsers, press Command-Shift-W to close the window (and thus all its tabs). To close all tabs but keep the window open, you can use the menu: File > Close All Tabs in Safari, or right-click a tab and choose “Close Other Tabs” in Chrome/Firefox.

What if I accidentally close a tab and need it back? Press ⌘⇧T to reopen the last closed tab. You can press it repeatedly to reopen multiple tabs in reverse order. This works in Safari, Chrome, Firefox, and Edge, but not in every app that uses tabs (e.g., Finder does not support reopening closed tabs).

Does the shortcut work on external keyboards? Yes, as long as the keyboard has a Command (⌘) key. On a Windows keyboard connected to a Mac, the Windows key acts as the Command key, so press Windows-W to close a tab. If you’ve remapped the keys, check your keyboard settings.

Related Shortcuts Worth Knowing

Beyond closing, these tab shortcuts will speed up your browsing:

  • ⌘T — open a new tab.
  • ⌘⇧T — reopen the last closed tab.
  • ⌘1 through ⌘9 — jump to the first through ninth tabs.
  • ⌘9 — go to the last tab (in Safari, it’s the last tab; in Chrome, it’s the ninth).
  • Control-Tab — switch to the next tab; Control-Shift-Tab goes to the previous one.
  • ⌘L — move the cursor to the address bar, where you can type a new URL or search.

These shortcuts are standard across all major Mac browsers, so once you learn them, you can switch between Safari and Chrome without re-learning anything.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.