# Compare Two Lists

Compare two lists as sets and see which items are only in A, only in B, or shared — with counts. Ignore case, trim, dedupe, and leading zeros. Runs in your browser.

## Run it

- **CLI:** `gizza tool list-set-diff "apple
banana
cherry" 'list_b=banana
cherry
date'`
- **Web:** https://gizza.ai/tools/list-set-diff/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/list-set-diff/tool.json

## Inputs

- `list_a` — List A _(field)_
- `list_b` — List B _(field)_
- `separator` — Separator _(field)_
- `ignore_case` — Ignore case _(field)_
- `trim` — Trim whitespace _(field)_
- `ignore_blank` — Ignore blank items _(field)_
- `dedupe` — Remove duplicates _(field)_
- `ignore_leading_zeros` — Ignore leading zeros _(field)_
- `sort` — Sort order _(field)_

## Output

- Comparison (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `list_a` — List A
- `list_b` — List B
- `separator` — Separator
- `ignore_case` — Ignore case
- `trim` — Trim whitespace
- `ignore_blank` — Ignore blank items
- `dedupe` — Remove duplicates
- `ignore_leading_zeros` — Ignore leading zeros
- `sort` — Sort order

Example: `https://gizza.ai/tools/list-set-diff/?list_a=apple%0Abanana%0Acherry&list_b=banana%0Acherry%0Adate&separator=newline&ignore_case=true&trim=true&ignore_blank=true&dedupe=true&ignore_leading_zeros=true&sort=input`

---

## About this tool

**Compare Two Lists** treats each of your two lists as a set and tells you exactly how they
overlap: which items are **only in List A**, which are **only in List B**, and which are
**shared by both** — each section with a count, followed by a totals line that also reports the
**union** size. It's the fast way to reconcile two exports of anything: email subscribers,
customer IDs, SKUs, domains, package names, or feature flags.

Everything runs locally in your browser — nothing is uploaded.

### Worked example

**List A**

```
apple
banana
cherry
```

**List B**

```
banana
cherry
date
```

**Comparison**

```
Only in A (1):
apple

Only in B (1):
date

In both (2):
banana
cherry

Totals: A=3 · B=3 · only in A=1 · only in B=1 · in both=2 · union=4
```

`apple` is unique to A, `date` is unique to B, and `banana`/`cherry` appear in both.

### Options

- **Separator** — split each list by new line (default), comma, tab, semicolon, pipe, or space.
- **Ignore case** — treat `Apple` and `apple` as the same item.
- **Trim whitespace** — strip leading/trailing spaces before comparing (on by default).
- **Ignore blank items** — drop empty lines (on by default).
- **Remove duplicates** — collapse repeats within a list so it behaves as a true set (on by
  default; turn it off to keep every occurrence).
- **Ignore leading zeros** — match `007` with `7`, handy for numeric IDs.
- **Sort order** — keep the input order (default), or sort each section A→Z or Z→A.

### Limits

- Up to 100,000 items per list.
- The item text you paste is compared as-is (after the options above) — there is no fuzzy or
  partial matching; `apple` and `apples` are different items.
- The displayed item keeps List A's original form when the same item is shared (so with
  **Ignore case** on, a shared `Bob@x.com` shows A's capitalization).

## FAQ

<details>
<summary>What is the difference between "only in A", "only in B", and "in both"?</summary>

**Only in A** are items present in your first list but missing from the second. **Only in B** are
items in the second list but missing from the first. **In both** are the items the two lists
share (the intersection). Together they make up the **union**, whose size is shown on the totals
line.

</details>

<details>
<summary>How do I compare comma-separated or tab-separated lists?</summary>

Change the **Separator** dropdown to `Comma`, `Tab`, `Semicolon`, `Pipe`, or `Space`. Both lists
are split the same way, so paste them in whatever format you have — one item per line is the
default.

</details>

<details>
<summary>Does it ignore duplicates and blank lines?</summary>

By default yes. **Remove duplicates** collapses repeated items within each list so the comparison
uses set semantics, and **Ignore blank items** drops empty lines. Turn **Remove duplicates** off
if you want every occurrence listed instead. Note the totals counts are always unique-set based,
so `union` always equals `only in A + only in B + in both`.

</details>

<details>
<summary>Can it match items that differ only by case or leading zeros?</summary>

Yes. Enable **Ignore case** to treat `Apple` and `apple` as the same item, and **Ignore leading
zeros** to treat `007` and `7` as equal — useful for reconciling numeric IDs, order numbers, or
SKUs that were exported with different zero-padding.

</details>

<details>
<summary>Is my data uploaded anywhere?</summary>

No. The comparison runs entirely in your browser via WebAssembly — your lists never leave your
device.

</details>

## Related tools

- [Text Diff](https://gizza.ai/tools/text-diff/): Compare two text blocks and highlight added, removed, and changed lines.
- [Context Trimmer](https://gizza.ai/tools/context-trimmer/): Trim text to an approximate token budget for LLM prompts, keeping the head, tail, middle, or both ends. Runs locally in your browser.
- [Word Counter](https://gizza.ai/tools/word-count/): Count the words, characters, and lines in any block of text. Free, instant, runs entirely in your browser — no sign-up required.
- [Email Reply Cleaner](https://gizza.ai/tools/email-reply-cleaner/): Paste a replied or forwarded email and get just the fresh message — quoted lines, the reply chain, and signatures removed. Toggle each pass. Runs in your browser.
- [Text to Table](https://gizza.ai/tools/text-to-table/): Render delimited text (CSV, TSV, or custom-separated data) as an aligned ASCII or Markdown table.
