Original workflow test

Deduplicate Then Sort—or Sort Then Deduplicate?

A controlled comparison showing when cleanup order changes the final list.

Tested 2026-07-18 · Method: 8-line list with case, whitespace, and repeated values · By Dionis Ceban

Bottom line: The safest workflow makes normalization choices explicit, checks a small sample first, and keeps a human review step for meaning-sensitive changes.

Test matrix

Input or approachOperationObserved result
Deduplicate only6 linesWhitespace variants remain
Trim → deduplicate5 linesExact variants merge
Sort → deduplicate6 linesSorting does not normalize values
Trim → deduplicate → natural sort5 linesClean, predictable final list

Recommended workflow

  1. Trim first so invisible edge spaces stop creating false differences.
  2. Choose whether case should matter before deduplicating.
  3. Deduplicate before numbering.
  4. Use natural sort when values contain numbers such as Item 2 and Item 10.

How to reproduce this test

Copy the examples from the matrix into the relevant tool, apply only the named setting, and compare the output character by character. Browser and operating-system differences should not affect these JavaScript text operations.

What this test does not prove

This is a focused behavior test, not a guarantee for every document. Language rules, proprietary file formats, personally identifying data, and search-engine rendering all require context-specific review.

Try Text Cleanup Studio All guides