The fastest way to close a tab
Press Ctrl+W on Windows or Linux, or Command+W on Mac. The tab closes when ready and the browser moves focus to the next open tab. This is faster than reaching for the mouse and clicking the X button, and it works the same way in every major browser — Chrome, Firefox, Edge, and Safari.
If you have only one tab open, Ctrl+W closes the entire browser window instead. If you want to close the window deliberately, you can also use Ctrl+Q (Windows and Linux) or Command+Q (Mac), which closes all tabs at once.
Key Takeaways
- Ctrl+W (Windows/Linux) or Command+W (Mac) closes the current tab when ready without using the mouse.
- The browser automatically switches to the next open tab after you close one, so you stay in your workflow.
- If you close a tab by mistake, Ctrl+Shift+T (Windows/Linux) or Command+Shift+T (Mac) reopens it.
- Ctrl+Q or Command+Q closes the entire browser and all tabs at once, which is different from closing a single tab.
Closing multiple tabs at once
If you need to close several tabs in a row, press Ctrl+W repeatedly. 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 10 or 20 tabs open.
To close all tabs except the one you are currently viewing, right-click the tab you want to keep and select "Close other tabs" from the menu. This is not a keyboard-only method, but it saves time when you have many tabs and want to keep only one.
Recovering a tab you closed by mistake
Press Ctrl+Shift+T on Windows or Linux, or Command+Shift+T on Mac. The browser reopens the most recently closed tab. Press the same shortcut again to reopen the tab that was closed before that one, going back through your history.
This works even if you closed the tab several minutes ago, as long as you have not closed the browser itself. Once you close the entire browser window, the tab history is usually lost — though some browsers like Chrome and Firefox can restore your entire session if you reopen them quickly.
Closing tabs on different browsers
The Ctrl+W shortcut works identically in Chrome, Firefox, Edge, and Safari on Windows and Mac. Opera and Brave, which are built on the same engine as Chrome, also use Ctrl+W. If you switch between browsers, you do not have to learn different shortcuts.
Mobile browsers work differently — on iPhone Safari or Android Chrome, you tap the X button on each tab individually, or swipe to close tabs. There is no keyboard shortcut on mobile because most phones do not have a physical keyboard attached.
Why keyboard shortcuts are faster than the mouse
Your hands stay on the keyboard while you work, so pressing Ctrl+W takes less than a second. Reaching for the mouse, moving it to the tab bar, and clicking the X takes longer and breaks your focus. If you close tabs frequently — which most people do — the keyboard shortcut saves hours over time.
Learning a few keyboard shortcuts also reduces strain on your wrist and hand. Repeated reaching and clicking can lead to fatigue, while keyboard shortcuts distribute the work across different fingers and movements.
Closing tabs without losing your place
When you close a tab, the browser remembers it for a short time. If you close a tab by mistake and when ready press Ctrl+Shift+T, it reopens with all the content and scroll position intact. Wait too long, though, and the browser may forget it — especially if you close other tabs in the meantime.
If you think you might need a tab later but do not want it open right now, consider bookmarking it instead of closing it. Press Ctrl+D (Windows/Linux) or Command+D (Mac) to bookmark the current page, then close the tab. You can reopen it from your bookmarks whenever you need it.
Frequently Asked Questions
What happens to my browsing history when I close a tab?
Closing a tab does not delete your browsing history. The page remains in your history, and you can find it by pressing Ctrl+H (Windows/Linux) or Command+Y (Mac) to open the history menu. You can reopen the page from history, or use Ctrl+Shift+T to reopen the tab itself.
Can I close a tab without losing unsaved form data?
Most browsers warn you if you try to close a tab with unsaved form data. If you close it anyway, the data is lost. To be safe, copy any text you typed into a form before closing the tab, or use Ctrl+Shift+T to reopen the tab if you close it by mistake.
Is there a shortcut to close all tabs except one?
There is no keyboard-only shortcut for this in most browsers. Right-click the tab you want to keep and select "Close other tabs" from the menu. In some browsers you can also middle-click tabs to close them one at a time, which is faster than using the mouse to click the X.
What is the difference between closing a tab and closing the browser?
Closing a tab (Ctrl+W) closes only that one page. Closing the browser (Ctrl+Q or Command+Q) closes all open tabs and the entire process. If you have multiple tabs open and press Ctrl+Q, all of them close at once.
Why does Ctrl+W sometimes close my entire browser?
If you have only one tab open, Ctrl+W closes that tab and the browser window together, because there are no other tabs left. To avoid this, open a new tab first (Ctrl+T), then close the tab you want to close. The browser stays open with the new blank tab.