Close a single tab by clicking the X
To close one tab in Safari, Chrome, Firefox, or any other browser on your MacBook, move your cursor to the tab you want to close and click the small X button that appears on the right side of the tab. The tab closes immediately and you stay on whatever tab was open before it.
If you have many tabs open, the X button gets smaller as more tabs fill the space. You can still click it — aim for the right edge of the tab name. If you accidentally close a tab, use Command + Z to undo the close and bring it back.
Key Takeaways
- Click the X button on any tab to close it, or use Command + W to close the current tab without using your trackpad.
- Right-click a tab to see options like closing all tabs to the right or closing all other tabs at once.
- Command + Shift + W closes the entire browser window, not just one tab.
- If you close a tab by mistake, Command + Z brings it back within the same session.
Close the current tab using your keyboard
If your hands are already on the keyboard, use Command + W to close whichever tab you are currently viewing. This is faster than moving to your trackpad, especially if you are closing multiple tabs in a row.
Press Command + W once for each tab you want to close. The browser moves to the next tab automatically after each one closes. This works the same way in Safari, Chrome, Firefox, and most other browsers on macOS.
Close multiple tabs at once using the right-click menu
Right-click on any tab to see a menu with options for closing groups of tabs. The exact options depend on which browser you use, but most offer "Close Tab", "Close Other Tabs", and "Close Tabs to the Right".
"Close Other Tabs" closes every tab except the one you right-clicked on. "Close Tabs to the Right" closes the tab you clicked and every tab to its right, leaving tabs to the left open. This is useful when you have finished with a group of related tabs but want to keep earlier ones.
Close all tabs and the browser window
To close every tab at once along with the entire browser window, use Command + Q. This quits the browser completely. The next time you open it, you will start with a blank window or your home page, depending on your browser settings.
If you want to close all tabs but keep the browser window open, most browsers do not have a single keyboard shortcut for this. Instead, right-click on a tab and choose "Close Other Tabs" to keep only that one, then close it with Command + W. Alternatively, you can close the window with Command + W (which closes the window, not just the tab, when only one tab remains).
Reopen a closed tab if you closed it by mistake
If you close a tab and immediately realize you needed it, press Command + Shift + T to reopen the last tab you closed. You can press this combination multiple times to reopen tabs in reverse order — the most recently closed tab opens first.
This works only during the current browser session. Once you quit the browser completely, you cannot reopen closed tabs this way. If you closed a tab hours ago and then quit the browser, Command + Shift + T will not bring it back. Some browsers like Chrome and Firefox let you view your browsing history to find the site again.
Prevent accidental tab closes with browser settings
If you find yourself closing tabs by mistake often, some browsers let you adjust how easy it is to close a tab. In Chrome, you can right-click the tab and select "Pin Tab" to lock important tabs in place — pinned tabs cannot be closed by clicking the X and are harder to close by accident.
Safari does not have a pin feature, but you can use Command + Option + Right Arrow to move between tabs quickly, which helps you avoid clicking the wrong X. Firefox also lacks a built-in pin feature, though you can install extensions that add this ability. Check your browser's settings or help menu to see what options are available.
Frequently Asked Questions
What is the difference between Command + W and Command + Q?
Command + W closes the current tab or window. Command + Q closes the entire browser and all its tabs. If you have only one tab open, Command + W closes the window too. If you have multiple tabs, Command + W closes only the active tab and leaves the browser running.
Can I close a tab on someone else's MacBook without them knowing?
Yes, closing a tab leaves no trace unless the person checks their browser history or has a tab recovery feature enabled. However, if they have set their browser to reopen tabs on startup, they will see the closed tab is missing the next time they open the browser.
Why does my browser keep reopening tabs I closed?
Your browser is probably set to restore your previous session when it opens. Check your browser settings — in Chrome, look for "On startup" and change it from "Continue where you left off" to "Open the New Tab page." In Safari, go to Preferences and uncheck "Reopen windows when quitting an app."
Is there a way to close all tabs except one without right-clicking?
Not with a keyboard shortcut in most browsers. Right-clicking and choosing "Close Other Tabs" is the fastest method. Alternatively, you can close tabs one at a time with Command + W until only the one you want remains, though this takes longer if you have many tabs open.