UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

Free eBooks·About·Changelog·Privacy Policy·Terms of Service·Report a bug
HomeText & ContentText Sorter

Related Tools

Word CounterCase ConverterParagraph FormatterKeyword DensityText ReverserLorem IpsumEnglish Lorem IpsumBangla Lorem IpsumHindi Lorem IpsumArabic Lorem IpsumSpanish Lorem IpsumFrench Lorem IpsumGerman Lorem IpsumDutch Lorem IpsumPortuguese Lorem IpsumItalian Lorem IpsumRussian Lorem IpsumChinese Lorem IpsumJapanese Lorem IpsumKorean Lorem IpsumTurkish Lorem IpsumPersian Lorem IpsumSwahili Lorem IpsumUkrainian Lorem IpsumPolish Lorem IpsumIndonesian Lorem IpsumText ↔ BinaryText ↔ HexText ↔ Base64Morse CodeWhitespace RemoverLine CounterText DiffFind & ReplaceSlug ConverterText CleanerURL EncodeNumber to WordsRoman NumeralsDuplicate RemoverPalindromeNATO AlphabetText CipherReading LevelEmoji RemoverWord FrequencyChar Limit CheckerCapitalization ToolText RepeaterLine NumberingText WrapperSentence CounterText ShufflerSyllable CounterText SeparatorText StatisticsASCII Art GeneratorSentence SplitterAvro Bangla TypingColumn Formatter

Text Line Sorter

Sort lines A-Z, Z-A, by length, reverse, shuffle, or extract unique lines. Options to trim and ignore empty lines.

You Might Also Like

All Text & Content

Duplicate Remover

Drop repeated lines from a list: keep the first copy, keep the last, or discard every entry that shows up more than once.

Line Counter

Count total, empty, non-empty, unique and duplicate lines at once, then pull out a deduplicated version of the list ready to paste elsewhere.

Text Reverser

Flip a block of text four ways: by character, by word order, by line order, or word order within each line, with original spacing preserved.

Paragraph Formatter

Clean and reformat text by removing extra spaces, collapsing blank lines, trimming each line, or joining into a single line.

Sorting lines looks like one operation until the list holds Item 2 and Item 10. The Text Line Sorter offers 8 orderings, two of which deduplicate as they go, plus a shuffle that reseeds on every click instead of handing back the arrangement it gave you last time.

A → Z compares with localeCompare rather than raw code units, which is why Ärger lands beside Arbeit instead of trailing after Zürich. The comparison is still textual, though, so Item 10 sorts ahead of Item 2: the 1 settles it and the digit after never gets a look in.

Three checkboxes reshape the input before any sorting happens. Trim lines and Ignore empty lines are on by default and Case-insensitive is off. A counter on the right reads 42 lines in → 37 out with the difference beside it, so a deduplicating mode reports its own effect. All of it runs locally.

What Each Sort Mode Returns

  • A → Z and Z → A order the whole line as text, so a leading space or a bullet character dominates the comparison. That is exactly what Trim lines is there to prevent.
  • Shortest First and Longest First compare character length and leave equal-length lines in their existing relative order.
  • Reverse Order flips the list without comparing anything, which makes it the one mode that can undo a sort applied upstream.
  • Shuffle runs a Fisher-Yates pass. Clicking it while it is already selected reshuffles, which needs an internal counter, since re-picking the same mode would otherwise change nothing at all.
  • Unique A→Z deduplicates then sorts, while Unique (preserve) deduplicates and leaves the survivors where they stood. Reach for the second when the order encodes something, such as a deployment sequence.

The Comparison Method Behind A to Z

  • localeCompare follows the browser's locale, so an identical list can order differently on a machine set to Swedish, where ä sorts after z rather than beside a.
  • Numbers are compared as text. To place Item 2 ahead of Item 10, pad it to Item 02 first.
  • Switch Case-insensitive on and both sides are lowercased for the comparison only. The output keeps your original capitalisation.
  • Unique A→Z with Case-insensitive off dedupes on the exact string, so NOTE and note both survive. Tick the box and only the first spelling remains.
  • The output counter skips blank lines when tallying what came out, so with Ignore empty lines unticked a plain sort can still report fewer lines out than in.
5 lines in → 5 out