To close a tab on a Mac, press Command-W to close the active tab, or Command-Shift-W to close the entire window. These shortcuts work in Safari, Chrome, Firefox, and most other Mac apps that use tabs.
Why Closing Tabs Feels Different on a Mac
If you’re coming from Windows, the muscle memory is different. On a PC, Ctrl+W closes a tab, and Alt+F4 closes the window. On a Mac, the Command key (⌘) replaces Ctrl for most shortcuts, and the red traffic-light button (top-left) closes a window, not just the active tab. This single difference causes most of the confusion.
Another quirk: in many Mac apps, pressing the red button closes the window but leaves the app running in the Dock. That’s not a bug—it’s macOS’s design. Closing a window does not quit the app, and it doesn’t necessarily close all tabs if the app restores them.
Keyboard Shortcuts That Close Tabs
These shortcuts work in Safari, Chrome, Firefox, Edge, and most tabbed apps (like Finder, Terminal, and TextEdit):
- Command-W – Close the current tab.
- Command-Shift-W – Close the entire window (all tabs in that window).
- Command-Option-W – Close all other tabs except the active one (Safari only).
- Command-Q – Quit the entire app (not just the window). Use with caution.
If you accidentally close a tab, press Command-Shift-T to reopen it. This works in Safari, Chrome, Firefox, and Edge. It will restore the tab you just closed, and if you press it repeatedly, it restores tabs in reverse order of closure.
How to Close Tabs with the Mouse or Trackpad
If you prefer pointing and clicking, there are several ways:
- Hover over the tab and click the X that appears on the left side of the tab (Safari) or the right side (Chrome, Firefox).
- Right-click (or Control-click) a tab and choose Close Tab from the context menu. You can also choose Close Other Tabs or Close Tabs to the Right.
- On a trackpad, you can close a tab by clicking the X, but there’s no built-in swipe gesture to close a tab in macOS (unlike some third-party apps).
If you have a mouse with a middle button (scroll wheel), click the middle mouse button on a tab to close it instantly. This works in all major browsers on Mac.
What Happens When You Close a Tab?
Closing a tab removes it from the window, but the browser keeps the page in its history. You can usually reopen it with Command-Shift-T. However, if you close a window (Command-Shift-W), the tabs are gone from view, but the browser may still restore them when you relaunch the app—if you have the right settings enabled.
In Safari, go to Safari > Settings > General and look at “Safari opens with:” and “Remove history items.” The “Remove history items” setting controls how long Safari keeps your browsing history, which affects whether closed tabs can be restored. In Chrome, go to Chrome > Settings > On startup to choose whether Chrome reopens the last session.
If you close a tab with unsaved form input (like a draft email), you’ll lose that input unless the site autosaves. Some sites (like Gmail) autosave drafts, but others don’t. There’s no universal “undo close” for form data—only for the tab itself.
How to Close All Tabs at Once
Sometimes you just want to start fresh. Here are your options:
- Close all tabs in a window: Press Command-Shift-W or click the red button while holding Option (Option-click the red button closes all tabs and quits the app in some apps).
- Close all tabs in all windows: Press Command-Option-W (works in Safari and Chrome). This closes every tab in every window but leaves the app running.
- Quit the browser: Press Command-Q. If you have “Reopen windows when quitting” enabled, the tabs will come back next time you open the app. To disable that, uncheck it in the quit dialog (hold Option when quitting to change the button to “Quit and Close All Windows”).
If you want to close a bunch of tabs but not all, you can select multiple tabs: hold Command and click tabs to select them, then press Command-W to close all selected tabs. This works in Chrome and Firefox, but not in Safari (as of macOS Sonoma).
Why Tabs Keep Coming Back (and How to Stop It)
A common complaint: you close all tabs, quit the browser, and when you reopen it, all your old tabs are back. That’s not the browser being stubborn—it’s the “restore session” feature.
In Safari, go to Safari > Settings > General and set “Safari opens with” to “A new window” or “A new private window.” If you want Safari to forget your tabs entirely, you also need to clear your history (History > Clear History) or set “Remove history items” to “Manually” and then clear it.
In Chrome, go to Chrome > Settings > On startup and choose “Open the New Tab page.” If you see “Continue where you left off,” that’s why tabs return. In Firefox, go to Firefox > Settings > General and under “Startup,” uncheck “Open previous windows and tabs.”
If you’re using a third-party tab manager or an extension like OneTab, that app may be restoring tabs automatically. Check the extension’s settings.
Frequently Asked Questions
Why doesn’t Command-W close the whole window?
Because Command-W is specifically “close the current tab.” To close the entire window, use Command-Shift-W. This is consistent across most Mac apps: Command-W closes the current document or tab, and Command-Shift-W closes the window or all tabs.
How do I undo closing a tab?
Press Command-Shift-T immediately after closing a tab. It works in Safari, Chrome, Firefox, and Edge. If you’ve closed multiple tabs, press it repeatedly to restore them in reverse order. If you quit the browser after closing a tab, you may still be able to restore the session by reopening the browser and using History > Recently Closed (Safari) or the same shortcut.
Does closing a tab delete my history?
No. Closing a tab removes it from the window, but the URL remains in your browsing history (unless you use private browsing). You can still find it in the History menu or by typing in the address bar. If you want to remove a specific page from history, you need to clear your history or use private browsing mode.
Why does my Mac close all tabs when I click the red button?
By default, clicking the red button closes the window, and if you have multiple tabs, it closes all of them. If you want to keep the tabs for next time, don’t click the red button—just close the individual tabs you don’t need. Or, hold Option while clicking the red button to close the window and quit the app (which may restore tabs next time, depending on settings).
Is there a way to close tabs with a swipe gesture?
Not built into macOS. Some third-party trackpad apps (like BetterTouchTool) can assign a swipe gesture to close a tab, but natively, macOS doesn’t support that. You can use the X button, Command-W, or middle-click.
Why do my tabs reappear after I close them?
Because the browser is set to restore the last session. Check your browser’s startup settings (Safari: Settings > General > Safari opens with; Chrome: Settings > On startup; Firefox: Settings > General > Startup). Also, if you’re using a tab manager extension, it may be saving and restoring tabs. Disable that extension or change its settings.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Unbox ASMR Codes: What They Are & How to Use5.00 min/km
- Repurposed Old Motorola Phone for Homelab?
- How to Evaluate AI Vendors for Data Security, Privacy & Compliance
- Best Ergonomic Mouse: Top Picks & Buying Guide
- Captions in Google Slides: How to Add & Format Them
- Use Mac Type in Japanese? Full Guide