Text Sorter
Sort up to 50,000 lines with stable English collation, natural number order, exact duplicate removal, and explicit cleanup controls.
Privacy: your files never leave your device. All processing happens locally in your browser.
How to use
- 1.Paste the line-oriented text to sort.
- 2.Choose direction, case and numeric comparison, then enable only the cleanup controls you want.
- 3.Sort the lines, verify the before-and-after counts and exact preview, then download the TXT result.
About Text Sorter
Text Sorter orders plain-text lines with a documented set of independent controls. Paste up to 1,000,000 UTF-16 code units and 50,000 logical lines, choose ascending or descending order, decide whether comparison is case-sensitive and number-aware, and optionally trim, remove empty lines, or remove exact duplicates. The complete result is rendered for review and can be downloaded as UTF-8 text. Nothing is uploaded to Lizely.
The tool recognizes CRLF, standalone CR, and LF as line boundaries. It emits LF between sorted lines. This means mixed input endings become consistent in the result, while every retained line's character content stays unchanged unless trimming is explicitly selected. Visual wrapping in the preview never creates extra logical lines.
Comparison uses the browser's English Intl.Collator. With case sensitivity off, letters that differ only by case compare as equivalent. Sorting is stable, so equivalent lines remain in their original relative order. With case sensitivity on, case participates in collation. This is linguistic browser collation, not a raw Unicode code-point or byte sort.
Natural number order makes digit runs compare numerically. For example, file2 sorts before file10 instead of after it. Turning the option off compares those values as ordinary text under the same collator. Natural sorting is useful for filenames and numbered labels, but it does not parse decimal quantities, dates, versions, units, or signed mathematical expressions as structured data.
Ascending applies the collator from lower to higher order. Descending reverses the comparison result while retaining stable order for values that compare as equal. It does not merely reverse the final ascending array, because reversing an array would also reverse equivalent entries and violate the stated stability rule.
Trim every line removes leading and trailing Unicode whitespace before other cleanup and sorting. It does not collapse spaces within a line. Remove empty lines runs after optional trimming, so a whitespace-only line becomes empty and is removed only when both relevant controls require it. Without trimming, a line containing spaces is not empty.
Remove exact duplicates also runs after optional trimming and empty-line removal but before sorting. Exact means JavaScript string equality: “Apple” and “apple” remain separate even when case-insensitive comparison treats them as equivalent. The first occurrence is kept, and later exact copies are removed. No fuzzy matching or Unicode normalization is applied.
The result reports both original logical line count and final line count. A difference is caused by empty-line or exact-duplicate removal, not by sorting itself. Changing any input or option clears the old output immediately so a previous count cannot be confused with the new configuration.
Use this tool for word lists, filenames, labels, simple inventory values, test data, copied table columns, and line-oriented notes. It is not a CSV-aware sorter. A CSV row can contain quoted line breaks, and sorting individual physical lines can corrupt its record structure. Use a format-aware table tool when quoting, headers, or multiple columns matter.
Collation can differ from database ORDER BY behavior, operating-system filename order, spreadsheet locale settings, or another programming language. If sorted output will become a contractual or reproducible machine artifact, confirm that English browser collation and the selected numeric/case options match the destination system.
The 1,000,000-character and 50,000-line limits bound splitting, decorated stable sorting, preview rendering, and Blob creation. An over-limit input is rejected before sorting, and no partial output is returned. Exactly the documented limits are accepted.
Download creates a temporary UTF-8 Blob URL only after a click and schedules immediate revocation after the browser starts the file transfer. The operation uses no remote service, external dataset, random input, or account history. The same accepted text, browser collation implementation, and options produce the same line sequence.
Methodology & sources
Reject malformed UTF-16 surrogate sequences, validate nonempty input at or below 1,000,000 UTF-16 code units, split CRLF before standalone CR or LF and reject more than 50,000 lines, optionally trim each line, remove resulting empty lines, and retain only the first exact duplicate; decorate remaining lines with their current indices, compare with an English Intl.Collator configured for explicit case and numeric behavior, apply ascending or descending comparison while using index as the stable tie breaker, join with LF, and create a short-lived UTF-8 Blob URL on download click.
Frequently asked questions
- Does numeric order put item2 before item10?
- Yes when Natural number order is enabled; otherwise both are compared as ordinary text.
- Does duplicate removal ignore case?
- No. It removes exact duplicate strings only, after optional trimming.
- Are Windows line endings supported?
- Yes. CRLF, CR, and LF are recognized, and generated output uses LF.
- Is my text uploaded?
- No. Cleanup, sorting, previewing, and download creation happen locally.
Related tools
- Remove Duplicate LinesKeep the first occurrence of each line with optional case and edge-whitespace comparison, while preserving the retained text exactly.
- Remove Empty LinesRemove empty or whitespace-only lines without trimming, reflowing, or changing the content of retained lines.
- Reverse WordsReverse non-whitespace token order while keeping every original space, tab, and line-break run in its exact position.
- Text ReverserReverse text without breaking emoji, combining accents, or ordinary line endings.
- Add Line Numbers to TextNumber every line of pasted text from a chosen starting value with a custom separator and optional zero padding.
- Add Prefix and Suffix to LinesAdd literal prefix and suffix text to every pasted line, with an option to leave blank lines untouched.
Text Tools guides
View all- Remove Emoji from Any Text Without Losing Formatting
- Yes, You Can Copy and Paste Emojis Anywhere in One Click
- How to Extract Email Addresses From Excel Cells
- Count Text Occurrences in Excel Without Formulas
- Count Characters in a String in Python (Plus Real-Time Counts)
- How to Change Case in an Excel Sheet Without Formulas
- Make LinkedIn Posts Stand Out with Bold Text
- Add a Prefix to All Lines in a File on Linux the Easy Way
- How Do I Add a Number to Text on Every Line
- How to Reverse Text Without Breaking Emojis
- How to Copy Special Characters with Unicode Names and Codes
- Count Lines in a File in Linux Without Command-Line Hassle
- Remove Line Break Symbols in Outlook Without Losing Formatting
- Extract Email Addresses from a Cell in Excel in One Click
- How to Generate Random Words in Excel
- How to Emoji Copy and Paste From Any Browser
- How to Generate Lorem Ipsum Online
- How to Create a Random List in Excel Without Formulas
- How to Use Kaomoji: Copy and Paste Japanese Emoticons
- Count Characters in a Cell in Excel and Beyond for Social Media