The fastest way to close all tabs in a browser is to press Ctrl+Shift+W on Windows or Cmd+Shift+W on Mac. This closes the entire window and all tabs inside it; if you want to close all tabs but keep the browser open, use Ctrl+Shift+T after closing to restore them, or use the browser’s built-in “Close all” option from the tab context menu.
Why the Shortcut Works Differently Across Browsers
Every major browser—Chrome, Edge, Firefox, Safari, Opera, and Brave—supports Ctrl+Shift+W (Windows/Linux) and Cmd+Shift+W (Mac) as the universal “close window” command. This is inherited from the standard Windows and macOS keyboard conventions. However, the exact behavior can vary slightly:
- Chrome and Edge: Ctrl+Shift+W closes the entire window. If you have multiple windows open, it only closes the active one.
- Firefox: Same as Chrome, but Firefox also offers a “Close Other Tabs” option in the right-click menu of any tab.
- Safari: Cmd+Shift+W closes the window; Cmd+Option+W closes all other tabs except the active one.
- Opera and Brave: Follow Chrome’s behavior, as they are Chromium-based.
If you accidentally close a window, press Ctrl+Shift+T (Windows) or Cmd+Shift+T (Mac) to reopen the last closed window with all its tabs restored. This works in all major browsers and can be repeated to restore multiple closed windows.
How to Close All Tabs Without a Keyboard
If you prefer using the mouse, every browser provides a graphical way to close all tabs at once:
- Right-click on any tab (not the tab bar itself, but a tab).
- Choose “Close other tabs” to close every tab except the one you clicked.
- Choose “Close tabs to the right” to close all tabs after the current one.
- Choose “Close all tabs” (or “Close window”) to close the entire window.
Alternatively, you can click the X icon on the window title bar (Windows/Linux) or the red close button (Mac) to close the entire window, which closes all tabs. On Mac, the red button may only close the window but keep the app running; to quit the browser entirely, press Cmd+Q.
How to Choose the Right Method for Your Situation
Deciding which shortcut to use depends on what you want to achieve:
- Close all tabs but keep the browser open: There is no single shortcut for this. You must either close the window and reopen it (Ctrl+Shift+W then Ctrl+Shift+T) or use the tab context menu to close all tabs individually (which is tedious). Some browsers allow you to set startup to “Continue where you left off,” so closing the window and reopening will restore all tabs automatically.
- Close all tabs and start fresh: Use Ctrl+Shift+W (or Cmd+Shift+W) and then open a new window. The browser will show its default homepage or new tab page.
- Close only the current tab: Use Ctrl+W (Windows) or Cmd+W (Mac). This is the most common shortcut and is easy to remember because it’s the same as closing a document in most programs.
- Close all tabs in all windows at once: There is no built-in shortcut for this. You would need to close each window individually, or use the browser’s “Exit” option (usually under the menu) which quits the browser entirely, closing all windows.
Common Problems and Misconceptions
One frequent misconception is that Ctrl+Shift+W is the same as “close all tabs” but keeps the browser running. In reality, it closes the entire window. If you have only one window open, the browser may exit completely (on Windows, the process ends; on Mac, the app may stay in the dock).
Another issue: some users accidentally press Ctrl+Shift+T expecting to close tabs, but that shortcut actually reopens closed tabs. This is a common source of confusion because the “T” stands for “tab” but the action is reversed.
If you use a browser extension like “OneTab” or “Tab Manager,” those extensions may override or add their own shortcuts. Check your browser’s shortcut settings (usually at chrome://extensions/shortcuts in Chrome, or about:addons in Firefox) to see if any extension has captured Ctrl+Shift+W.
Comparison: Browser-Specific Shortcuts
Here is a quick comparison of the most relevant shortcuts across the big four browsers:
- Chrome/Edge/Brave/Opera: Ctrl+Shift+W closes window; Ctrl+Shift+T reopens last closed window; Ctrl+W closes current tab.
- Firefox: Ctrl+Shift+W closes window; Ctrl+Shift+T reopens last closed window; Ctrl+W closes current tab. Firefox also has Ctrl+Shift+P for private window, but no special “close all” shortcut.
- Safari: Cmd+Shift+W closes window; Cmd+Shift+T reopens last closed tab (not window); Cmd+W closes current tab. To close all tabs except the active one, use Cmd+Option+W.
- Internet Explorer (legacy): Ctrl+Shift+W closes window, but it is no longer supported; use Edge instead.
Safety and Data Loss Considerations
Closing all tabs can cause you to lose unsaved work in web apps like Google Docs, email drafts, or online forms. Before using Ctrl+Shift+W, consider:
- Save any work in web-based editors (Google Docs auto-saves, but other sites may not).
- If you have forms partially filled, they may be lost.
- Use browser session restore features: In Chrome, go to Settings > On startup > “Continue where you left off”. In Firefox, Options > General > Startup > “Restore previous session”. In Edge, Settings > Profiles > Startup.
- If you close a window accidentally, immediately press Ctrl+Shift+T to restore it. Do not open many new tabs first, as that may push the closed window out of the restore history.
Alternatives to Closing All Tabs
If you don’t want to lose your tabs but need to reduce clutter, consider these alternatives:
- Bookmark all tabs: Press Ctrl+Shift+D (Windows) or Cmd+Shift+D (Mac) to bookmark all open tabs into a folder. Then you can close them safely and reopen later.
- Use tab groups: In Chrome and Edge, right-click a tab and select “Add to new group” to organize tabs. You can collapse groups to reduce visual clutter without closing them.
- Suspend tabs: Extensions like “The Great Suspender” (note: it had a security issue in 2021, so use a maintained alternative like “Auto Tab Discard”) unload tabs from memory while keeping them open.
- Use a session manager: Extensions like “Session Buddy” or “Tab Session Manager” let you save and restore entire windows of tabs.
- Open a new window: Instead of closing all tabs, just open a new window (Ctrl+N) and leave the old one in the background. This is useful if you want a clean slate without losing your previous session.
Frequently Asked Questions
Does Ctrl+Shift+W work in all browsers? Yes, it is a standard shortcut in Chrome, Edge, Firefox, Safari, Opera, and Brave on both Windows and Mac. On Linux, it also works in most browsers. The only exception is older versions of Safari on Mac, where Cmd+Shift+W might not be recognized; use Cmd+Option+W instead to close other tabs.
How do I close all tabs on a Mac? Press Cmd+Shift+W to close the entire window. If you want to close all tabs but keep the window open, you can right-click a tab and choose “Close Other Tabs” (in Safari, it’s under the tab’s context menu). Alternatively, press Cmd+Option+W in Safari to close all other tabs.
What if I accidentally close all tabs? Can I undo it? Yes, press Ctrl+Shift+T (Windows) or Cmd+Shift+T (Mac) to reopen the last closed window with all its tabs. You can press it multiple times to restore several closed windows. This works in Chrome, Edge, Firefox, and Safari (Safari only restores tabs, not windows, with Cmd+Shift+T).
Is there a shortcut to close all tabs except the current one? Not a universal one. In Chrome and Edge, right-click a tab and select “Close other tabs”. In Firefox, right-click a tab and choose “Close Other Tabs”. In Safari, press Cmd+Option+W. There is no keyboard-only shortcut for this in most browsers.
Does closing all tabs clear my browsing history? No, closing tabs does not clear your history, cookies, or cache. It only removes the tabs from the current session. Your browsing data remains stored unless you clear it manually or use private/incognito mode.
Can I set my browser to warn me before closing multiple tabs? Most browsers do not have a built-in warning for closing a window with multiple tabs. However, you can enable a confirmation prompt in some browsers via flags or extensions. For example, in Chrome, you can use an extension like “Close Tab Confirmation” to add a warning. Firefox has a built-in setting: Options > General > “Warn me when closing multiple tabs” (check that box).
Related
- Windows Zoom Out Shortcut Keys: Full Guide
- Generate Random Numbers in MATLAB: randi, rand & More
- Online Computer Skills Courses for Data Entry
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Add a Cover Page to a Word Document: Steps and TipsTo add a cover page in Microsoft Word for Microsoft 365 on Windows, open the document and choose…
- Uniform Inventory Spreadsheet: Build a Useful TrackerCreate a uniform inventory spreadsheet in Excel with one row per item and size, columns for opening stock,…
- Conditional Formatting Multiple Cells in Excel: RulesYes. In Excel for Microsoft 365, select the cells you want to format, then choose Home > Conditional…
- How to Count in Excel While Skipping Specific Cells ManuallyTo count numeric values in Excel while excluding chosen cells, subtract the count of those cells from the…
- Create a Calendar Template in Outlook: A Practical GuideYes. You can create a reusable calendar setup in Outlook, but the best method depends on what you…
- Excel Goal Seek Integer? How to Get Whole-Number ResultsNo. Excel Goal Seek does not have an integer constraint, so its changing cell can end up with…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.