The fastest way to close a tab
Press Ctrl+W on Windows or Linux, or Command+W on Mac. That closes the tab you are currently viewing. The keyboard shortcut works in every major browser — Chrome, Firefox, Safari, Edge — and is faster than moving your mouse to the X button.
If you close a tab by accident, press Ctrl+Shift+T (Windows/Linux) or Command+Shift+T (Mac) to reopen it. This works even if you closed multiple tabs in a row — each press reopens the next most recent one.
The shortcut closes only the active tab, meaning whichever one you are reading right now. If you have five tabs open and you press Ctrl+W, only the current tab disappears. The other four stay open.
Key Takeaways
- Ctrl+W (Windows/Linux) or Command+W (Mac) closes the tab you are currently on without touching any other tabs.
- Ctrl+Shift+T (Windows/Linux) or Command+Shift+T (Mac) reopens the most recent tab you closed, even if you closed it minutes ago.
- The keyboard shortcut works the same way in Chrome, Firefox, Safari, Edge, and most other browsers.
- If you want to close the entire browser window instead of just one tab, use Ctrl+Q (Windows/Linux) or Command+Q (Mac).
Closing multiple tabs at once
If you want to close all tabs except the one you are reading, right-click the tab you want to keep and select "Close other tabs." This option appears in the context menu in Chrome, Firefox, and Edge. Safari calls it "Close Other Tabs" in the same menu.
To close all tabs and the browser window together, use Ctrl+Q on Windows or Linux, or Command+Q on Mac. This is different from Ctrl+W, which closes only the current tab and leaves the browser running.
Some browsers let you close a tab by middle-clicking the X button with your mouse wheel. This is faster than a regular click if you are already using the mouse, but the keyboard shortcut is still quicker if your hands are on the keyboard.
Switching between tabs without closing them
If you want to move between tabs instead of closing them, use Ctrl+Tab (Windows/Linux) or Control+Tab (Mac) to jump to the next tab. Press Ctrl+Shift+Tab (Windows/Linux) or Control+Shift+Tab (Mac) to go to the previous tab.
You can also jump directly to a specific tab by number. Press Ctrl+1 through Ctrl+8 to go to tabs one through eight in order. Ctrl+9 takes you to the last tab, no matter how many you have open. This works the same way on Mac with Command instead of Ctrl.
These shortcuts let you navigate your open tabs without using the mouse, which is useful when you are reading or typing and do not want to break your rhythm.
Reopening a closed window instead of just a tab
If you closed an entire browser window by accident — not just a single tab — press Ctrl+Shift+N on Windows or Linux, or Command+Shift+N on Mac. This reopens the last window you closed, along with all the tabs that were in it.
This is different from Ctrl+Shift+T, which reopens only the most recent single tab. Use the window shortcut when you closed the whole browser window, and use the tab shortcut when you closed just one tab within a window that is still open.
Why the keyboard shortcut is worth learning
Moving your hand to the mouse, finding the X button, and clicking it takes about two seconds. Pressing Ctrl+W takes less than one second and works whether your tabs are small or large, whether you are on a laptop trackpad or a desktop mouse, and whether the X button is visible on your screen.
The shortcut also works when your browser is zoomed in or out, when you have many tabs open, or when your screen is crowded with windows. The mouse method fails in all those situations because the X button becomes harder to see or reach.
If you close tabs regularly — which most people do — learning this one shortcut saves you time every single day.
Frequently Asked Questions
What if Ctrl+W does not work?
Check whether your browser is in focus. If another window is active, the shortcut may go to that program instead. Click inside the browser window first, then try Ctrl+W again. If it still does not work, your browser may have a custom keyboard setting — check the Settings menu under Keyboard Shortcuts.
Can I close a tab on my phone or tablet?
Phones and tablets do not have keyboard shortcuts the same way computers do. On iPhone or iPad, swipe up on a tab to close it. On Android, tap the X button on the tab. Some Android browsers let you long-press a tab and select "Close," but the swipe or tap method is faster.
Does Ctrl+W work in all browsers?
Yes, Ctrl+W works in Chrome, Firefox, Safari, Edge, Opera, and most other browsers. It is one of the few shortcuts that is the same across all major browsers, so once you learn it, you do not have to remember different shortcuts for different programs.
What happens to my browsing history when I close a tab?
Closing a tab does not delete it from your browsing history. The page you were on stays in your history, and you can find it again by pressing Ctrl+H to open the history menu. Closing a tab just removes it from your open tabs — the record of where you went remains.
Can I set up a custom keyboard shortcut to close tabs?
Most browsers do not let you change the Ctrl+W shortcut because it is built into the browser itself, not a customizable feature. Some extensions in Chrome and Firefox let you create custom shortcuts for other actions, but closing tabs is already so fast with Ctrl+W that changing it is not necessary.