Skip to main content

Text Tools

Line Sorter & Duplicate Remover

Sort and clean one-item-per-line text without uploading it.

Line Sorter & Duplicate Remover tool

Loading tool…

Jump to a section

About This Tool

Line-based lists often need more than a simple alphabetical sort. Version labels, filenames, IDs, copied spreadsheet columns, allowlists, inventories, and notes may contain duplicate rows, blank lines, mixed capitalization, or numbers that sort badly as plain text. This tool keeps each line as one item and lets you sort ascending or descending, reverse the existing order, keep the original order while cleaning, apply natural numeric ordering, trim line edges, and optionally remove empty or duplicate lines. Processing stays in your browser.

How To Use It

  1. Paste or type one item per line.
  2. Choose ascending, descending, Reverse order, or Keep order. Keep order applies cleanup options without alphabetizing the list.
  3. Adjust case sensitivity and natural numeric ordering to match the list's meaning.
  4. Enable trimming, empty-line removal, or duplicate removal only when you intentionally want those transformations.
  5. Review the input/output counts and copy the transformed list.

Examples

Natural filename order

With natural numeric order enabled, file2 sorts before file10. Plain lexical sorting can place file10 before file2 because it compares characters rather than embedded number values.

Clean a copied list

Enable Trim each line, Remove empty lines, and Remove duplicates to clean a column copied from a document or spreadsheet before pasting it into another system.

Preserve capitalization differences

Enable case sensitivity before removing duplicates when Alpha and alpha should remain separate items rather than being treated as the same line.

Reverse a generated sequence

Reverse order flips the current line sequence without alphabetizing it, which is useful for logs, chronological notes, or lists already sorted elsewhere.

Useful Notes

Natural numeric sorting

Natural numeric ordering asks the browser's locale-aware collator to compare numeric-looking parts as numbers. This makes labels such as item2 and item10 sort in the order people commonly expect. Disable it when every character should participate in ordinary lexical ordering.

Case sensitivity affects sorting and duplicates

When case sensitivity is off, the comparator treats capitalization differences as equivalent for ordering and duplicate detection uses a lowercase comparison key. The first matching line is retained when duplicates are removed. Turn case sensitivity on when capitalization carries meaning.

Trimming is a destructive transformation

Trim each line removes leading and trailing whitespace before sorting or deduplication. That can intentionally merge lines that differed only by surrounding spaces, but it also changes exact text. Leave trimming off when whitespace is significant.

Line endings are normalized

Windows CRLF and older carriage-return line endings are normalized to newline characters in the output. The content within each line is otherwise preserved unless you enable trimming or removal options.

Local text processing

Sorting and cleanup happen in the browser. The tool does not need to upload the pasted list to a Hanakash API, making it suitable for ordinary local text cleanup. Avoid placing secrets into any web page unless doing so is appropriate for your environment.

FAQ

Can I remove duplicates without sorting alphabetically?

Yes. Choose Keep order, then enable Remove duplicates. The first occurrence is retained and the remaining lines stay in their original sequence after any enabled trimming or empty-line removal.

Why does item10 sometimes appear before item2?

That is typical lexical ordering. Keep Natural numeric order enabled when embedded numbers should compare numerically so item2 precedes item10.

Are Alpha and alpha considered duplicates?

By default, yes when duplicate removal is enabled because case sensitivity is off. Enable Case sensitive if capitalization should make them distinct.

Does trimming remove spaces inside a line?

No. Trim each line removes whitespace only from the beginning and end of each line. Interior spaces remain unchanged.

Does the tool upload my list?

No. The sorting and cleanup operations are performed locally in the browser and do not require a Hanakash API request.