scalpel@labs: ~/glossary/duplicate-tabs.mdx5 sections

What Are Duplicate Tabs and How to Close Them

Duplicate tabs are two or more tabs pointing at the same web address. Closing duplicates removes the extras and keeps one copy of each page. A pinned copy is always the one kept, so a tab you rely on is never the one closed.

extension: Scalpel Manage Tabsupdated: 2026-08-14read_time: 3 min
less duplicate-tabs.mdx

Why it matters

Duplicate tabs happen to everyone. You open a link, forget it is already open, and open it again. Middle-click a bookmark you have misremembered. Context-switch between windows and accidentally reopen a page you thought you were already on. After a day of browsing, you might have the same page open in three separate tabs without realising.

Closing duplicates saves screen space, reduces clutter, and stops the same page from pinging the server twice. It is also fast: instead of finding each extra tab and closing it one by one, you find them all at once and close the batch in a single click. The extension handles the comparison and the removal for you.

How it works

The extension compares every open tab's address to every other tab's address to find matches. What counts as "the same address" depends on your settings.

By default, the query string matters. A URL like example.com/page?id=1 is treated as different from example.com/page?id=2, because the query string usually names a different resource (different product, different article, different result). If you do not want the query string to count, you can toggle it off. The same choice applies to fragments after the hash: example.com/page#top and example.com/page#bottom are different by default, but you can group them.

Trailing slashes and leading www. prefixes can also be treated as differences or ignored, depending on what you choose. Each setting lets you tighten or relax how strictly addresses must match.

When duplicates are found, the extension picks one to keep. The keeper policy decides which: keep the active tab, keep the first tab opened, or keep the last. Regardless of the policy, a pinned copy always wins. If you have one pinned and two unpinned copies of a page, the pinned one survives and the unpinned ones close. This protects tabs you have deliberately pinned, since a pinned tab is a choice you made.

What does not matter

Closing a duplicate tab does not clear your history. The page is still in your history, still searchable in Chrome's history panel, still available through the back button on other tabs that visited it. Closing one tab is just closing one tab. Your session and your data are untouched.

Closing duplicates is not the same as closing all instances of a page across the entire browser. It closes the spare tabs of the same page you have open right now. If you open the same news article in three windows, closing duplicates closes the spares in one window, not all three.

The keeper policy is a preference, not a guarantee. If none of your copies are pinned, the policy decides. If any copy is pinned, the pinned one is always kept. The idea is simple: you pinned it deliberately, so the extension respects that choice and keeps the pinned tab.

Code example

Here is how the extension identifies duplicate tabs based on URL comparison settings:

function urlsAreDuplicates(url1, url2, settings) {
  let a = new URL(url1);
  let b = new URL(url2);
  
  // Normalize based on settings
  if (!settings.ignoreQueryString) {
    a.search = '';
    b.search = '';
  }
  if (settings.ignoreFragment) {
    a.hash = '';
    b.hash = '';
  }
  if (settings.ignoreWWW) {
    a.hostname = a.hostname.replace(/^www\./, '');
    b.hostname = b.hostname.replace(/^www\./, '');
  }
  if (settings.ignoreTrailingSlash) {
    a.pathname = a.pathname.replace(/\/$/, '');
    b.pathname = b.pathname.replace(/\/$/, '');
  }
  
  return a.href === b.href;
}

How Scalpel Manage Tabs shows it

Scalpel Manage Tabs finds duplicates by comparing every tab's URL against every other tab's URL, using your chosen settings. When duplicates are found, the extension highlights them in the tab list, grouped by address. Click the close-duplicates button to remove the extras instantly, keeping one copy of each address. The settings panel has toggles for query string, fragment, www. prefix, and trailing slash, so you control what counts as a duplicate. The extension always respects pinned tabs, so a page you pinned will never be closed even if there are unpinned copies of it.

Sources