How to Delete Tabs With a Keyboard: Shortcuts for Every Browser and OS

Closing browser tabs with a mouse works fine — until you're deep in a research session with 30 tabs open and want to move faster. Keyboard shortcuts for deleting tabs are one of those small efficiency upgrades that compound quickly, and they vary just enough across browsers, operating systems, and workflows that it's worth understanding the full picture before defaulting to one method.

The Universal Shortcut Most People Already Know

On virtually every major desktop browser — Chrome, Firefox, Edge, Safari, Opera, and Brave — the standard shortcut to close the current (active) tab is:

  • Windows / Linux: Ctrl + W
  • macOS: Cmd + W

This closes whichever tab you're currently viewing. It doesn't require you to click the tab's X button, and it works instantly. If you've closed a tab by mistake, Ctrl + Shift + T (or Cmd + Shift + T on Mac) reopens the most recently closed tab in most browsers — a useful recovery move.

Closing Tabs You're Not Currently Viewing

Things get more nuanced when you want to close a tab that isn't active. There's no single universal shortcut to close a background tab without switching to it first. Your options generally fall into a few categories:

Navigate then close: Use Ctrl + Tab to cycle forward through tabs, or Ctrl + Shift + Tab to cycle backward. Once the target tab is active, hit Ctrl + W to close it.

Jump directly by number: Most browsers support Ctrl + 1 through Ctrl + 8 (or Cmd + 1–8 on Mac) to jump to a specific tab by position. Ctrl + 9 typically jumps to the last tab. Combine this with Ctrl + W to close a specific tab without touching the mouse.

Close all tabs at once: Ctrl + Shift + W closes the entire browser window, including all tabs within it. This is the keyboard equivalent of clicking the window's close button — use it carefully.

Browser-Specific Behavior Worth Knowing 🖥️

Not every browser handles tab keyboard control identically. A few distinctions:

BrowserClose TabReopen Closed TabNotes
ChromeCtrl/Cmd + WCtrl/Cmd + Shift + TReopens full session history
FirefoxCtrl/Cmd + WCtrl/Cmd + Shift + TSame behavior
EdgeCtrl/Cmd + WCtrl/Cmd + Shift + TConsistent with Chrome
Safari (Mac)Cmd + WCmd + Z or Cmd + Shift + TCmd + Z works in Safari specifically
OperaCtrl/Cmd + WCtrl/Cmd + Shift + TConsistent with Chromium base

Safari on macOS behaves slightly differently — Cmd + Z can undo a tab close immediately after it happens, which is a faster recovery method than the reopen shortcut in some situations.

Deleting Tabs in Non-Browser Contexts

Tab management isn't exclusive to browsers. The same concept applies in several other environments:

Code editors (VS Code, Sublime Text):

  • Ctrl + W closes the current editor tab in VS Code on Windows/Linux
  • Cmd + W on macOS does the same
  • Some editors use Ctrl + F4 as an alternative

Terminal emulators: Applications like Windows Terminal, iTerm2, or GNOME Terminal support tab closing, but shortcuts vary by app configuration. Windows Terminal defaults to Ctrl + Shift + W; iTerm2 uses Cmd + W.

Spreadsheet and document apps: In tools like Excel or Google Sheets, tabs represent worksheets rather than document tabs. Closing a sheet is done through right-click menus — keyboard shortcuts for this aren't standardized the same way.

Mobile browsers: Keyboard shortcuts don't apply to touchscreen-only use. If you're using a tablet or phone with a Bluetooth keyboard, some shortcuts may work, but support is inconsistent across mobile browsers.

The Variables That Affect Which Shortcuts Work for You ⌨️

Several factors determine which approach fits your situation:

  • Operating system — macOS users replace Ctrl with Cmd in almost every case. Linux behavior generally mirrors Windows.
  • Browser choice — Chromium-based browsers (Chrome, Edge, Brave, Opera) behave nearly identically. Firefox is close but has some unique behaviors. Safari follows its own conventions.
  • Keyboard layout — Non-standard or compact keyboards may require Fn key combinations or remapping to access certain shortcuts.
  • Custom key bindings — Power users and developers sometimes remap shortcuts through browser extensions (like Vimium) or OS-level tools, changing which keys do what entirely.
  • Application context — Whether you're in a browser, an IDE, or a terminal changes which shortcuts apply and whether Ctrl + W does what you expect.

When Default Shortcuts Aren't Enough

For users who manage large numbers of tabs regularly, the built-in shortcuts cover the basics but may not address every workflow. Browser extensions designed for tab management can add shortcuts for bulk-closing tabs by domain, closing tabs to the left or right, or suspending rather than deleting tabs entirely. These tools introduce their own key binding options and typically require some configuration to match your habits.

The degree to which keyboard-only tab management works smoothly — or requires supplementing with extensions, remapping, or workarounds — depends heavily on the specific browser version, OS, and how demanding your tab workflow actually is.