The quickest way to close a tab

Ctrl+W closes the active tab on Windows, Mac, and Linux in every major browser. Press and hold Ctrl (or Cmd on Mac), then tap W once, and the tab disappears. The next tab to the right becomes active, or if you were on the rightmost tab, the one to the left takes focus.

This is faster than reaching for the mouse to click the X button, especially if your hands are already on the keyboard. It works the same way in Chrome, Firefox, Edge, and Safari, so you only need to remember one shortcut across all browsers.

If you close a tab by accident, Ctrl+Shift+T (or Cmd+Shift+T on Mac) reopens it. You can press this multiple times to restore tabs in reverse order — the most recently closed tab comes back first.

Key Takeaways

  • Ctrl+W closes the current tab when ready on Windows, Mac, and Linux in all major browsers.
  • Cmd+W is the Mac equivalent and works the same way in Safari, Chrome, and Firefox.
  • Ctrl+Shift+T reopens a closed tab if you close one by mistake, and you can press it multiple times to restore several tabs.
  • Ctrl+Q closes the entire browser window on Windows and Linux; Cmd+Q does the same on Mac.
  • Alt+F4 closes the whole window on Windows but does not work the same way on Mac or Linux.

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" from the menu. This works in Chrome, Firefox, and Edge. You can also close all tabs to the right of your current tab by right-clicking and choosing "Close tabs to the right."

To close the entire browser window instead of just one tab, use Ctrl+Q on Windows and Linux, or Cmd+Q on Mac. This closes all open tabs and windows at once. If you have unsaved work or forms you were filling out, most browsers will warn you before closing.

When Ctrl+W does not work

Some web applications and games capture the Ctrl+W shortcut for their own use, so the keyboard command closes something inside the app instead of the browser tab. If this happens, click the browser's address bar first to give focus back to the browser itself, then try Ctrl+W again.

In rare cases, a website may prevent you from closing the tab with a keyboard shortcut as a security measure. You can always close it by clicking the X button in the tab bar, or by closing the entire window and reopening your browser.

Closing tabs on different browsers

Chrome, Firefox, Edge, and Safari all use Ctrl+W (or Cmd+W on Mac) to close tabs. Opera also uses the same shortcut. If you switch between browsers, you will not need to learn different commands — the shortcut is universal across modern browsers.

Older versions of Internet Explorer used different shortcuts, but Internet Explorer is no longer supported by Microsoft. If you are still using it, Edge is the modern replacement and uses Ctrl+W like every other current browser.

Keyboard shortcuts that work with tabs

Beyond closing, several other keyboard shortcuts help you manage tabs without touching the mouse. Ctrl+Tab moves you to the next tab to the right, and Ctrl+Shift+Tab moves you to the previous tab to the left. You can press these repeatedly to cycle through all your open tabs.

Ctrl+N opens a new browser window, and Ctrl+T opens a new tab in the current window. Ctrl+Shift+N opens a new private or incognito window, depending on your browser. These shortcuts let you manage your entire browsing session from the keyboard.

If you want to jump to a specific tab by number, Chrome and Firefox support Ctrl+1 through Ctrl+8 to jump directly to tabs 1 through 8. Ctrl+9 always takes you to the rightmost tab, no matter how many you have open.

Why keyboard shortcuts save time

Closing tabs with Ctrl+W is about 0.5 seconds faster than moving your hand to the mouse, finding the X button, and clicking it. Over a day of browsing, this adds up — especially if you work with many tabs open and close them frequently. The real benefit is keeping your hands on the keyboard and your eyes on the screen without the distraction of switching input methods.

If you spend most of your day typing, coding, or writing, staying on the keyboard is a natural rhythm. Learning a few tab shortcuts makes your workflow smoother because you do not have to break focus to reach for the mouse.

Frequently Asked Questions

What is the difference between closing a tab and closing a window?

Closing a tab (Ctrl+W) closes only that one page. Closing a window (Ctrl+Q on Windows/Linux, Cmd+Q on Mac) closes the entire browser and all tabs in it. If you have multiple windows open, closing one window does not affect the others.

Can I undo closing a tab if I closed it hours ago?

Ctrl+Shift+T reopens recently closed tabs, but only for the current session. Once you close the browser completely, that history is gone. Some browsers like Chrome and Firefox let you view your browsing history and reopen pages that way, but it is not the same as the undo shortcut.

Does Ctrl+W work on mobile devices?

No. Mobile browsers do not have physical keyboards by default, so keyboard shortcuts do not explore. On a phone or tablet, you close a tab by tapping the X button on the tab itself, or by swiping the tab away if your browser supports that gesture.

What if I want to close a tab without losing my place on the page?

Closing a tab does not save your scroll position or form data unless the website itself saves it. If you need to come back to the exact same spot, bookmark the page first, or use your browser's history to return to it later.