gizmobench

List Compare

Paste a list into each box and the four answers appear together: In both, Only in A, Only in B, and In one but not both, each with its own count, its own Copy and its own download. The pages on this search usually answer one of those questions at a time and hand back a single column, which means running the comparison again to see the rest. Two other things are done differently here. Nothing is sorted: every group comes back in the order the lines were first seen, so the answer still lines up with the spreadsheet column it came from. And duplicates are a choice rather than a silent decision: Fold treats a repeated line as one entry, while Count keeps the repeats, shares the smaller of the two counts and shows the excess on the side that has it, which is what a stock list or an attendance sheet actually needs.

Two empty boxes.

All four answers at onceYour order, never sortedBoth lists stay in this browserNo account, no sign-up
Trim spaces
Case
Duplicates
  • In both0 lines, lines that appear in list A and in list B
    nothing in this group
  • Only in A0 lines, lines list B does not have
    nothing in this group
  • Only in B0 lines, lines list A does not have
    nothing in this group
  • In one but not both0 lines, everything missing from the other list
    nothing in this group

Paste a list into each box. The four results appear as you type, and nothing leaves this tab.

Every line is one item, so an entry written "Smith, John" stays whole and only a line break starts the next one. Blank lines are dropped. Trim spaces decides whether the space around a line counts as part of it, Case decides whether "Apple" and "apple" are the same line, and Duplicates decides whether a line that repeats is one entry (Fold) or as many as it appears (Count).

Why the order is the one you pasted. A list copied out of a spreadsheet carries meaning in its order: the row each item came from. Most comparison pages sort their answer, which quietly makes it impossible to paste back beside the column it came from. This one walks both lists once and keeps the position each line was first seen at, so the shared list reads in list A's order and each difference list reads in its own list's order. Where the two lists spell a line differently and Case is set to Ignore, the spelling shown is the first one seen.
Accuracy. Exact string comparison on the lines you paste, after the trim and case options you choose. Every list is returned in the order the lines were first seen, never sorted. In counting mode a line that repeats is counted, and the shared list takes the smaller of the two counts.

Common questions

What counts as a match between the two lists?
Exact equality of the whole line, after the two options you set. Nothing is fuzzy and nothing is clever: "apple" and "apples" are different lines, "12" and "12.0" are different lines because a line is never read as a number, and "cafe" and "café" are different lines because accents are compared as they are written. The two options are the only things that change what counts as equal. Trim spaces, on by default, strips the space at each end of a line before comparing, so " apple" and "apple" are the same line; turn it off and that leading space is part of the line and the two are different. Case set to Ignore, the default, makes "Apple" and "apple" the same line, and the spelling shown in the results is the first one seen; set it to Match and they are two lines. Blank lines are dropped on both sides, so a gap between blocks is never compared as an item.
What is the difference between Fold and Count?
Fold treats each different line as one entry however often it repeats. Count keeps the repeats and pairs them off. Here is the same pair of lists under both: list A holds a, a, b and list B holds a, c. With Fold you get In both: a. Only in A: b. Only in B: c. With Count you get In both: a, because B has only one a to pair with. Only in A: a, b, since A's second a has nothing to pair with. Only in B: c. In other words the shared group takes the smaller of the two counts and the difference groups carry the excess, so every line you pasted is accounted for exactly once. Fold is what a followers list or an email list needs. Count is what a stock take or an attendance sheet needs, where three of a part number is not the same as one.
Does the tool keep the order I pasted?
Yes, and that is deliberate. Nothing on this page is sorted. In both reads in list A's order, Only in A reads in list A's order, Only in B reads in list B's order, and In one but not both is Only in A followed by Only in B. A list copied out of a spreadsheet carries meaning in its order, the row each item came from, so a sorted answer is one you cannot paste back beside the column it came from. If two lists spell a shared line differently and Case is set to Ignore, the spelling shown is the one seen first.
Are my lists uploaded anywhere?
No. The comparison runs in your browser, so there is no server in this, no account to make and nothing sent or logged. Both drafts and your three option choices are remembered in this browser alone, so the lists are still there when you come back, and the Start over button above the tool forgets them. One exception is worth knowing: a list longer than 100,000 characters is still compared in full, but it is not written to storage, so a very large paste is not kept after you close the tab.
How many lines can I compare?
Up to 200,000 lines in each list, and blank lines are not counted towards it. Two lists that size are compared in well under a second on a current machine, because the work happens on your own device rather than in a queue on somebody's server. Past that the tool says which list went over and how many lines it reached, instead of stalling, and suggests splitting the list and comparing the parts one at a time. There is no minimum: one empty box is a valid comparison and returns the other list whole under Only in A or Only in B.
How do I get everything that is in one list but not both?
That is the fourth group, In one but not both, sometimes called the symmetric difference. It is Only in A and Only in B stacked together, so it answers "what changed between these two lists" in one column. Every group has its own Copy button and its own Download, which writes that group as a plain text file, one line per entry, and Copy all writes all four groups under labelled headings with their counts. The rows on screen spell out the first twelve lines and count the rest, but Copy and Download always write every line.
Can I compare two columns from a spreadsheet?
Yes. Copy one column, paste it into List A, copy the other into List B, and the four answers appear as you type. A cell that carries trailing spaces still matches its twin because Trim spaces is on by default. Commas inside a cell are safe: only a line break starts the next item, so an entry written "Smith, John" stays one item. Because the order you pasted is kept, the result can go straight back into the sheet, and Swap exchanges the two boxes when you realise you pasted them the wrong way round.

Exact string comparison on the lines you paste, after the trim and case options you choose. Every list is returned in the order the lines were first seen, never sorted. In counting mode a line that repeats is counted, and the shared list takes the smaller of the two counts.