Two List Comparator
Compare two lists as sets or duplicate-aware multisets using explicit separators and Unicode normalization, with count deltas in an item ledger.{{ summaryTitle }}
{{ summaryLine }}
Reconciliation overview
- {{ row.label }}
- {{ row.value }}
Next action
The chart renderer is unavailable. The same reconciliation counts remain available in the overview and item ledger.
| Item | Match | Left | Common | Right | Delta | Status | Copy |
|---|---|---|---|---|---|---|---|
{{ row.display }}Left: {{ variantText(row.left_variants) }} · Right: {{ variantText(row.right_variants) }} | {{ matchLabel(row.match_basis) }} | {{ row.left_count }} | {{ row.common_count }} | {{ row.right_count }} | {{ signedCount(row.delta) }} | {{ statusLabel(row.classification) }} | |
No rows match this filter.Choose another ledger view; the canonical comparison is unchanged. | |||||||
Item ledger
Two lists can disagree in more than one way. An identifier may exist only on the left, only on the right, or on both sides with different occurrence counts. Before reconciling inventory codes, email addresses, filenames, account IDs, or test records, decide whether presence alone matters or whether every duplicate represents a separate item.
| Comparison | What counts | Example |
|---|---|---|
| Set | Membership of each distinct item | Two copies on the left and one on the right still mean “present on both.” |
| Multiset | Membership and occurrence count | Two copies on the left and one on the right leave one unmatched left occurrence. |
Text matching also depends on what is considered equivalent. Leading spaces, composed and decomposed accented characters, letter case, repeated whitespace, and punctuation can make visually similar items different at the character level. Normalization can remove that noise, but each relaxed rule can also merge identifiers that were meant to stay distinct. For example, ignoring punctuation makes AB-12 match AB12.
Separators need the same care. A comma is useful for simple values but unsafe when commas belong inside an item. Line breaks are usually the least surprising choice for identifiers copied from reports, while tab or semicolon separation may fit exported records. The delimiter should be chosen explicitly rather than guessed from the text.
A useful reconciliation keeps original spellings visible even when normalized keys match. That lets a reviewer distinguish a harmless formatting variation from a source-data problem that should be corrected upstream.
How to Use This Tool:
Choose the matching policy before acting on differences. The same source text can reconcile differently when duplicate or normalization rules change.
- Paste or load the reference values into Left list and the values being checked into Right list.
- Select the Item separator used by both sources. Comma, tab, and semicolon modes also recognize line breaks.
- Choose Set for membership-only review or Multiset when duplicate counts must balance.
- Set the matching rules. Trimming item edges and NFC Unicode normalization are on initially; case, internal whitespace, and punctuation remain significant until you choose otherwise.
- Use Reconciliation overview for totals, then inspect Item ledger for left and right counts, deltas, original variants, and whether a match required normalization.
Interpreting Results:
Difference groups counts distinct comparison keys, not raw rows. In set mode it includes keys found on only one side. In multiset mode it also includes keys present on both sides with unequal counts.
- A positive Delta means more occurrences on the left; a negative delta means more on the right.
- Common is the minimum of the two counts in multiset mode and one shared membership in set mode.
- Normalized means different original strings produced the same comparison key under the selected rules.
- Ignored blank tokens records empty entries skipped after splitting, which can expose extra delimiters or blank lines in the source.
Do not treat fewer differences as automatically better. If turning on Ignore punctuation or Ignore letter case removes a mismatch, check whether that distinction carries meaning in the real identifier system.
Technical Details:
Reconciliation has two stages. Each source is split into items and transformed into comparison keys. The two key indexes are then joined, preserving source variants and occurrence counts for the ledger.
Transformation Core
Enabled text rules run in a fixed order so repeated comparisons remain deterministic:
- Convert line endings and split on the selected delimiter; comma, tab, and semicolon modes also split on line breaks.
- Normalize to Unicode Normalization Form C (NFC) when enabled.
- Trim leading and trailing whitespace when enabled.
- Collapse each internal whitespace run to one space when enabled.
- Remove Unicode punctuation when enabled, then collapse and trim whitespace again if those rules are active.
- Apply Unicode lowercase mapping when case is ignored.
Original source strings remain attached to each comparison key. A non-empty item that becomes empty after the selected transformations is rejected rather than silently disappearing.
Rule Core
| Result | Set mode | Multiset mode |
|---|---|---|
| Common count | 1 when the key appears on both sides | Minimum of left count and right count |
| Left-only count | 1 when the key appears only on the left | Maximum of left count minus right count, or 0 |
| Right-only count | 1 when the key appears only on the right | Maximum of right count minus left count, or 0 |
| Difference group | Key appears on one side only | Key appears on one side only, or its counts differ |
Source order follows first appearance on the left, followed by previously unseen right-side keys. Alphabetical ordering compares normalized keys and changes presentation only.
| Boundary | Limit |
|---|---|
| Each source | 512 KiB of UTF-8 text |
| Non-empty items per source | 20,000 |
| One raw item | 2,000 Unicode code points |
| Null control character | Rejected |
A source with no non-empty items is invalid. Blank tokens are skipped and counted, while original spelling is retained for every accepted item.
Worked Examples:
Duplicate-aware identifier check
Suppose the left list contains SKU-1 twice and the right list contains sku-1 once. With semicolon separation, multiset mode, trimming, NFC normalization, ignored case, collapsed whitespace, and ignored punctuation, both spellings share the key sku1. The ledger shows one common occurrence and a delta of +1, so the group remains a difference even though membership matches.
References:
- Unicode Standard Annex #15: Unicode Normalization Forms, Unicode Consortium, Unicode 17.0.0.
- Counter objects and multiset operations, Python Software Foundation, Python 3.14.7.