The fastest way to close a tab is a keyboard shortcut, not your mouse

Most browsers close the current tab when you press Ctrl+W on Windows or Command+W on Mac. This works in Chrome, Firefox, Edge, and Safari. The shortcut closes whichever tab you are looking at right now — you do not have to click on it first. If you have only one tab open, the shortcut closes the entire browser window instead.

The reason this matters: reaching for your mouse to click an X button takes longer than pressing two keys. Once you use the keyboard shortcut a few times, it becomes automatic, and you save seconds with every tab you close. Over a day of browsing, those seconds add up.

Key Takeaways

  • Press Ctrl+W (Windows) or Command+W (Mac) to close the tab you are currently viewing.
  • Press Ctrl+Shift+W (Windows) or Command+Shift+W (Mac) to close the entire browser window and all its tabs at once.
  • If you close a tab by accident, press Ctrl+Shift+T (Windows) or Command+Shift+T (Mac) to reopen it when ready.
  • The keyboard shortcut works the same way in Chrome, Firefox, Edge, and Safari, so you only need to learn it once.

Close one tab at a time with Ctrl+W or Command+W

When you press Ctrl+W on a Windows computer or Command+W on a Mac, the browser closes the tab that is currently active — the one you are reading or typing in. The browser then shows you the next tab to the right, or the tab to the left if you were on the rightmost tab.

You can press the shortcut repeatedly to close multiple tabs in a row. Each time you press it, one tab closes and the browser moves to the next one. This is much faster than clicking the X button on each tab individually, especially when you have many tabs open.

The shortcut works even if you are in the middle of typing or scrolling. You do not have to finish what you are doing or move your hands to the mouse — just press the two keys and the tab closes.

Close all tabs and the window with Ctrl+Shift+W or Command+Shift+W

If you want to close the entire browser window and every tab in it at once, press Ctrl+Shift+W on Windows or Command+Shift+W on Mac. This is useful when you are done browsing and want to shut down the browser completely, or when you have opened so many tabs that closing them one by one would take too long.

Most browsers will warn you before closing multiple tabs at once. A small popup will appear asking you to confirm that you want to close all the tabs. Click the button that says "Close all" or "Yes" to proceed. If you change your mind, click "Cancel" and the tabs stay open.

Be aware that closing the window this way does not save your tabs for later. If you want to pick up where you left off, use your browser's session restore feature instead — most browsers can reopen all your tabs from your last session when you restart.

Reopen a closed tab with Ctrl+Shift+T or Command+Shift+T

If you close a tab by accident, you can bring it back when ready by pressing Ctrl+Shift+T on Windows or Command+Shift+T on Mac. The browser reopens the most recently closed tab and puts you back on the page you were viewing. You can press the shortcut multiple times to reopen tabs in reverse order — the most recent one first, then the one before that, and so on.

This shortcut works even after you have closed several tabs. Your browser keeps a history of closed tabs, usually going back to your last browsing session. If you close a tab and realize a few minutes later that you needed it, this shortcut will bring it back without having to search for the page again.

The undo shortcut does not work if you have closed the entire browser window. Once you shut down the process completely, the closed tab history is usually lost. However, if you closed just the tab and the browser is still open, you can always reopen it.

Navigate between tabs without closing them

If you want to move between tabs without closing any of them, use Ctrl+Tab on Windows or Command+Option+Right Arrow on Mac to move to the next tab. Press Ctrl+Shift+Tab on Windows or Command+Option+Left Arrow on Mac to move to the previous tab.

You can also jump directly to a specific tab by number. On Windows, press Ctrl+1 through Ctrl+8 to go to the first through eighth tab. On Mac, press Command+1 through Command+8. Press Ctrl+9 (Windows) or Command+9 (Mac) to jump to the last tab, no matter how many tabs you have open.

These navigation shortcuts are helpful when you have many tabs open and want to switch between them quickly without using your mouse or trackpad. Combined with the close shortcut, you can manage your entire tab bar from the keyboard.

Why keyboard shortcuts are faster than using your mouse

Your hands are already on the keyboard when you are reading or typing. Moving your hand to the mouse, finding the tab's X button, and clicking it takes your attention away from what you are doing. A keyboard shortcut keeps your hands in one place and your eyes on the page.

The time difference per tab is small — maybe one or two seconds. But if you close ten tabs in a session, you save twenty seconds. Over a week of browsing, the time adds up to minutes. More importantly, the keyboard shortcut becomes automatic after a few uses, so you do not have to think about it. Your fingers just know to press Ctrl+W when you want a tab gone.

Keyboard shortcuts also work the same way across different browsers and operating systems. Once you learn Ctrl+W, you can use it in Chrome, Firefox, Edge, and Safari on Windows or Mac. You do not have to learn a different method for each browser.

Frequently Asked Questions

What happens if I close a tab with unsaved work?

Most browsers warn you before closing a tab that has unsaved changes, like a form you were filling out. A popup will appear asking if you want to leave the page. Click "Stay" to keep the tab open, or "Leave" to close it and lose your work. If the browser does not warn you, the page did not detect any unsaved changes, so it is safe to close.

Can I close multiple specific tabs without closing all of them?

You have to close tabs one at a time using Ctrl+W, or close all of them at once using Ctrl+Shift+W. There is no keyboard shortcut to close multiple selected tabs. If you want to close several tabs quickly, press Ctrl+W repeatedly for each one you want to close.

Does closing a tab delete my browsing history?

No. Closing a tab removes it from your screen but does not delete the pages you visited from your browser history. Your history stays saved until you clear it manually through your browser settings. You can still search for the page later using your history or by searching the web again.

Will the keyboard shortcut work if my browser is not in focus?

No. The shortcut only works when your browser window is the active window on your screen. If you are using another program, the shortcut will not close a browser tab. Click on your browser window first to make it active, then press the shortcut.

Is the keyboard shortcut the same in all browsers?

Yes. Ctrl+W on Windows and Command+W on Mac work in Chrome, Firefox, Edge, Safari, and most other browsers. This is one of the few shortcuts that is standardized across different applications, so once you learn it, you can use it everywhere.