Sort & Dedupe Lines

Works offlineNothing is uploadedFree, no sign-up
Compare with a second list

The list above is the first one. Every answer keeps the order it had and shows each value once.

Sort, dedupe, shuffle, trim and number lines of text — and compare two lists to see what is in both, what is only in one of them, and what the two make together. Natural sort puts file2 before file10, the duplicate remover keeps the original order, and the shuffle is genuinely uniform. Paste, click, copy back.

Chaining operations

Each button applies one operation to the input. For pipelines — trim, then dedupe, then sort — use Use as input between steps: the result moves to the left pane and the next click builds on it. The order matters and is yours to choose: dedupe-then-sort keeps the first occurrence of each duplicate, sort-then-dedupe keeps the alphabetically first.

Comparing two lists

The comparison is folded away under the operations because one list is the ordinary case. Opened, it takes a second list and answers five questions about the pair: in both, only in the first, only in the second, both together, and in exactly one. The five add up — the two “only” answers are the two halves of what changed, and adding what is in both gives everything across the pair — so the set you did not ask for is never the one you needed.

Where each operation earns its keep

OperationTypical job
natural sortfilenames, versions, anything humans numbered
dedupemerged mailing lists, log lines, tag lists
compare two liststhis month's export against last month's, a list checked against one you already have
shufflequiz questions, playlists, fair ordering
trim + remove emptydata pasted out of spreadsheets
numberturning a list into an ordered reference

Everything runs locally; the page works offline once loaded.

Frequently asked questions

What does natural sort change?

It compares runs of digits as numbers rather than characters, so file2 sorts before file10 and version 1.9 before 1.10 — the order every file manager shows and plain alphabetical sorting breaks. The comparison is exact even for ids too long for floating point, and zero-padded values keep a stable order (7 before 007).

Does removing duplicates change the order?

No — the first occurrence of each line stays where it was and later repeats disappear. A dedupe that also sorted would destroy information you did not ask to lose; if you want both, run the two operations in the order you mean, using the result as input for the next step.

Can I compare two lists?

Yes. Open “Compare with a second list”, paste the other list, and the five buttons answer the five questions a comparison has: what is in both, what is only in the first list, what is only in the second, what the two make together, and what appears in exactly one of them. The answer lands in the same output box as every other operation, so it can be copied, downloaded, or sent back as the input for the next step.

How does a comparison treat duplicates, case and stray spaces?

Each distinct value appears once in every answer, keeping the spelling and the position of its first occurrence — a comparison answers whether something is in a list, not how many times it was pasted into it. If you need the repeat count, run Remove duplicates and read how many lines it took out. “Ignore case” applies to comparing as well: the match is made on the folded text and the result prints what you typed. Spaces at the ends of lines are ignored by default, because a column copied out of a spreadsheet is the usual reason two identical values refuse to match.

Is the shuffle actually random?

It is a Fisher–Yates shuffle, the algorithm with a provably uniform result — every ordering equally likely. The naive alternative people write (sorting by a random key) is measurably biased. For picking winners with stakes attached, use the random number generator on this site, which draws from the cryptographic generator.

Why is sorting not locale-aware?

Deliberately. Browsers ship incomplete collation data for smaller languages — Azerbaijani among them — and silently fall back to root rules while claiming success, so a locale-aware sort would produce confidently wrong orders depending on who is looking. Code-point order with an ignore-case option is deterministic on every machine; for the special case of numbered names, natural sort does the part people actually miss.

How are line endings and the final newline handled?

Windows CRLF and old Mac CR endings are read as line breaks, and output uses LF. A trailing newline at the end of the input is treated as a terminator, not an extra empty line — so sorting a file does not invent a blank first line, the classic artefact of naive splitting.

Is my list uploaded anywhere?

No — every operation runs in your browser. Lists of names, emails and inventory are exactly the kind of data that should not travel; here it never does.

Related tools