The fastest way to close a tab
Close any open tab by pressing Ctrl+W on Windows or Linux, or Command+W on Mac. The tab disappears when ready and the browser moves you to the next tab. This works in every major browser — Chrome, Firefox, Safari, and Edge — and is faster than reaching for your mouse to click the X button.
The shortcut closes only the current tab, not the entire browser window. If you have multiple tabs open, the one you are viewing will close and you will stay in the browser. If it is the last tab open, the browser window itself closes.
This shortcut works the same way whether you are on a website, a blank tab, or any other page. You do not need to be focused on any particular part of the page — as long as the browser window is active, the shortcut will work.
Key Takeaways
- Press Ctrl+W (Windows/Linux) or Command+W (Mac) to close the current tab when ready.
- The shortcut works in Chrome, Firefox, Safari, Edge, and most other browsers without any setup.
- If you close the last tab, the entire browser window closes as well.
- You can close multiple tabs in a row by pressing the shortcut repeatedly.
- If you close a tab by mistake, press Ctrl+Shift+T (Windows/Linux) or Command+Shift+T (Mac) to reopen it.
Closing multiple tabs at once
If you want to close several tabs quickly, press Ctrl+W or Command+W multiple times in a row. Each press closes the current tab and moves to the next one. This is much faster than clicking each X individually, especially when you have five or more tabs open.
You can also close all tabs except the one you are viewing. Right-click on the tab you want to keep and select "Close other tabs" from the menu. This option appears in Chrome, Firefox, and Edge. In Safari, you will need to close tabs one at a time or use the keyboard shortcut repeatedly.
Closing all tabs and the browser window
To close the entire browser window and all its tabs at once, press Ctrl+Q on Windows and Linux, or Command+Q on Mac. This closes the browser completely, not just the tabs. You will lose any unsaved work or forms you were filling out.
Most browsers will warn you if you are about to close multiple tabs at once. A dialog box appears asking "Close all tabs?" — you can click "Close" to proceed or "Cancel" to go back. If you do not see this warning, your browser may have a setting that allows closing without confirmation.
Recovering a tab you closed by mistake
If you close a tab and when ready regret it, press Ctrl+Shift+T on Windows and Linux, or Command+Shift+T on Mac. The tab reopens with the same page you were viewing. This works for the last few tabs you closed, so you can press the shortcut multiple times to bring back several tabs in reverse order.
This recovery shortcut works in Chrome, Firefox, and Edge. In Safari, you will need to use the History menu instead — click History at the top, then "Reopen Last Closed Tab" or press Command+Shift+T.
The recovered tab will not remember where you were scrolled on the page or any text you had typed into forms. It straightforward reopens the web address. If you need to preserve your place on a page, consider bookmarking it instead of closing it.
Why keyboard shortcuts are faster than the mouse
Your fingers are already on the keyboard when you are typing or browsing. Moving your hand to the mouse, finding the X button, and clicking it takes about two seconds. Pressing Ctrl+W takes less than half a second because your hands never leave the keyboard.
Over the course of a day of browsing, using the keyboard shortcut instead of the mouse can save you several minutes. The shortcut also works the same way every time — the X button location can vary slightly between browsers, but Ctrl+W is identical everywhere.
Keyboard shortcuts for other tab tasks
Once you know how to close tabs, these related shortcuts become useful for managing your browser:
- Ctrl+T (Windows/Linux) or Command+T (Mac): Open a new tab.
- Ctrl+Tab (Windows/Linux) or Control+Tab (Mac): Move to the next tab to the right.
- Ctrl+Shift+Tab (Windows/Linux) or Control+Shift+Tab (Mac): Move to the previous tab to the left.
- Ctrl+N (Windows/Linux) or Command+N (Mac): Open a new browser window.
Learning these shortcuts together makes tab management much faster. You can open a new tab, navigate between tabs, and close them all without touching the mouse.
Frequently Asked Questions
Does Ctrl+W work the same way in all browsers?
Yes. Ctrl+W on Windows and Linux, and Command+W on Mac, close the current tab in Chrome, Firefox, Safari, Edge, and Opera. The shortcut is standardized across all major browsers, so once you learn it, you can use it everywhere.
What happens if I close a tab with unsaved work?
The tab closes when ready and any text you typed into forms or documents is lost. Most websites save your work automatically, but local documents or forms do not. If you are worried about losing work, save it before closing the tab, or use Ctrl+Shift+T to reopen the tab right away.
Can I close a tab without using the keyboard?
Yes. Click the X button on the tab itself, or right-click the tab and select "Close tab" from the menu. The keyboard shortcut is just faster once you get used to it.
Will closing a tab delete my browsing history?
No. Closing a tab only closes that one page. Your browsing history remains in the browser and you can still see it in the History menu. To delete your browsing history, you need to use the browser's settings or privacy menu.