W3docs

Tools

Compare Two Lists

Paste two lists, one item per line, and instantly see what is only in the first list, only in the second, in both, and repeated within each.

Runs in your browser — your lists never leave this device.

7 items
6 items
List A
76 unique
List B
65 unique
Only in A
4
Only in B
3
In both
2

Only in A4

ana@example.com
carla@example.com
eli@example.com
Hugo@example.com

Only in B3

fatima@example.com
gus@example.com
hugo@example.com

In both2

ben@example.com
dev@example.com

Duplicates in A1

ItemCount
ben@example.com2

Duplicates in B1

ItemCount
gus@example.com2

How to compare two lists

Paste one list into List A and another into List B, one item per line. A column copied from Excel or Google Sheets works as is. The tool shows three groups straight away: items only in A, items only in B, and items in both, each with a count. It also lists items that appear more than once inside the same list, with how many times.

Items are compared as exact text. Trim spaces (on by default) ignores spaces and tabs at the start and end of each line, so red matches red. Ignore case makes Apple and apple the same item. Sort output orders every result list alphabetically; otherwise items keep the order they first appear in. Empty lines are skipped. Numbers are compared as text, so 1, 01 and 1.0 are three different items.

Everything runs in your browser. Your lists are never uploaded or sent to a server, so you can compare customer emails, order IDs or other private data safely. Lists of 100,000 lines or more work fine.

Worked example

Two short lists with one repeated item. Trim spaces is on, ignore case and sort are off.

Inputtext
List A        List B
apple         banana
banana        date
cherry        elder
date          fig
apple
Resulttext
Only in A (2):  apple, cherry
Only in B (2):  elder, fig
In both (2):    banana, date
Duplicates in A: apple ×2

apple appears twice in List A, so it is listed once under "Only in A" and again under duplicates with its count.

The same comparison in JavaScriptjs
const a = new Set(listA.split('\n').map((s) => s.trim()).filter(Boolean))
const b = new Set(listB.split('\n').map((s) => s.trim()).filter(Boolean))

const onlyA = [...a].filter((x) => !b.has(x))
const onlyB = [...b].filter((x) => !a.has(x))
const both = [...a].filter((x) => b.has(x))

A Set gives each lookup constant time, which is why even very long lists compare in a fraction of a second.

Frequently asked questions

How do I compare two columns from Excel?

Select the cells of the first column, copy them, and paste into List A. Do the same for the second column and List B. Each cell becomes one line, and Windows line endings are handled.

Why does an item show up as different when it looks the same?

Usually a hidden difference: letter case, a space inside the text, or a look-alike character. Turn on Ignore case for case differences. Trim spaces only removes spaces at the ends of a line, never inside it.

How are duplicates counted?

An item counts as a duplicate when it appears more than once in the same list. The count is the total number of times it appears. In the Only in and In both groups each item is listed once.

Which version is shown when Ignore case is on?

The first spelling seen in that list. For items in both lists, the spelling from List A is shown.

Is my data uploaded anywhere?

No. The comparison runs entirely in your browser and nothing you paste or open is sent over the network.

Can I export the result?

Yes. Each group has a Copy button, and Download CSV saves every group side by side in one file that opens in Excel or Google Sheets.