Skip to content

Compare Two Lists

Compare two line-based lists in one pass and get stable union, common, A-only, B-only, and symmetric-difference outputs with optional case sensitivity.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Paste one item per line into List A and List B, then choose whether letter case changes membership.
  2. 2.Compare and inspect In both, Only in A, Only in B, Union, and Either not both sections.
  3. 3.Copy the labeled report and verify its literal line policy against the destination system.

About Compare Two Lists

Compare Two Lists treats each nonblank trimmed line as one set member and calculates five useful views: items in both lists, only in A, only in B, the union, and items in either list but not both. Enter two lists, choose case sensitivity, compare, inspect every section, and copy all labeled results locally.

The operation names follow standard set meanings documented independently by MDN and Python. Union contains members in either or both sets. Intersection, labeled In both, contains common members. A-only and B-only are directional differences. Symmetric difference contains members in exactly one set.

Before comparison, CRLF and standalone CR line endings become LF. Each line is trimmed, blank lines are removed, and duplicate keys keep their first displayed spelling. The tool does not sort results, so output follows the first occurrence order from List A and then new List B members where applicable.

In case-insensitive mode, Apple and apple share one membership key. If Apple appears first in List A, that spelling is displayed in common and union results. Case-sensitive mode treats those two lines as different members. The selected policy applies consistently to deduplication and all five operations.

For A containing apple, banana, pear and B containing banana, peach, the common result is banana. A-only is apple and pear, B-only is peach, union is apple, banana, pear, peach, and symmetric difference is apple, pear, peach. The same arrays feed the visible panels and copied report.

Each input is limited to one million UTF-16 code units and 50,000 lines. These bounds keep splitting, maps, rendering, and clipboard output predictable. If both normalized lists are empty, or either limit is exceeded, the tool returns an explicit error without partial results.

The implementation uses stable maps rather than the newest native Set operation methods, avoiding a browser-compatibility dependency while preserving standard semantics. Keys determine membership; stored values preserve the first human-readable line. No quadratic all-pairs comparison is needed.

Whitespace inside a line is preserved after surrounding whitespace is trimmed. The tool does not parse CSV, split commas, normalize Unicode, remove punctuation, compare numbers numerically, resolve URLs, or perform fuzzy matching. One physical line is one literal item under the chosen case rule.

Copy all results produces five uppercase headings in a fixed order with LF-separated values. An empty section contains an em dash so absence remains visible. Clipboard success is reported only after confirmation; denial produces a manual-copy instruction rather than silent success.

Use the comparison for email lists, inventory identifiers, keyword sets, URL collections, filenames, attendee names, migration checks, allowlists, or simple data cleanup. Review case policy and whitespace before treating a result as authoritative, especially when a downstream system has different normalization rules.

The tool is not a database join, spreadsheet merger, diff viewer, fuzzy deduplicator, security access-control validator, or reconciliation service. It has no knowledge of aliases, equivalent domains, Unicode confusables, numeric ranges, or business identities. It compares the exact normalized line keys only.

No input or result is uploaded, stored, logged to a comparison service, or sent to an AI model. Editing either textarea clears the prior result. Tests pin eight external set-operation cases, empty-set boundaries, duplicates, first-spelling stability, case modes, report formatting, and the empty-input error.

Methodology & sources

Normalize CRLF and CR to LF, reject inputs over one million code units or 50,000 lines, trim each line, discard blanks, and store the first displayed value per exact or English-lowercased key; compute common as A keys in B, A-only and B-only as directional differences, union as all A values followed by new B values, and symmetric difference as A-only followed by B-only; preserve stable order; format five labeled LF sections; and write only confirmed clipboard output.

Frequently asked questions

What is the difference between union and symmetric difference?
Union includes items in either or both lists; symmetric difference includes items in exactly one list.
How are duplicates handled?
Each membership key appears once and keeps its first displayed spelling and order.
Are Apple and apple the same item?
They are the same by default and different when case-sensitive comparison is enabled.
Are my lists uploaded?
No. Parsing, set operations, rendering, and clipboard writing happen locally.

Text Tools guides

View all