Line Sorter

Sort, deduplicate and clean lines of text. Multiple sort modes, instant results, 100% in your browser.

Input
Sorted Output
Paste lines above to sort them.

How to Use the Line Sorter

  1. Paste your text — one item per line — into the left panel.
  2. Choose a sort mode using the chips: A-Z, Z-A, Length, Numeric, Random, or Custom column sort.
  3. Configure options — enable Remove Duplicates, Trim Whitespace, Ignore Case, or Remove Empty Lines as needed.
  4. View sorted output in the right panel instantly as you type or change options.
  5. Copy or download the result using the buttons above the output panel.

Sort Modes Explained

A-Z (Alphabetical)

Sorts lines in ascending alphabetical order using locale-aware comparison. Numbers appear before letters in most locales. Special characters like hyphens and underscores sort before alphanumeric characters. Enable Ignore Case to sort case-insensitively, so "Apple" and "apple" sort together rather than separately (uppercase letters sort before lowercase by default in ASCII order).

Z-A (Reverse Alphabetical)

The reverse of A-Z sort — descends from Z to A. Useful for quickly seeing the last items in a list, reversing a sorted list, or finding the lexicographically largest items. This is not the same as reversing line order, which would require a separate operation.

Length Sort

Sorts lines by character count, shortest first. Empty lines (after trimming) sort to the top. This mode is useful for sorting keywords by length, finding the shortest or longest entries in a list, or preparing data where line length matters (such as CSS rules or SQL columns).

Numeric Sort

Extracts the numeric value from each line and sorts in ascending numeric order. Lines like "10 items", "2.5 kg", and "-3" will sort as numbers, not as strings (string sort would put "10" before "2"). Supports integers, decimals, negative numbers, and lines with mixed text and numbers. Lines with no extractable number are treated as zero.

Random / Shuffle

Randomly shuffles all lines using the Fisher-Yates algorithm, which gives a genuinely uniform distribution. Every permutation is equally likely. Useful for randomizing test data, shuffling a playlist, creating random assignment lists, or picking items in a random order. Each click of the Random chip re-shuffles the list.

Custom Column Sort

Splits each line by a delimiter (comma, tab, pipe, space, or custom character) and sorts by a specific column. For example, to sort a CSV by the third column, choose Comma delimiter and column index 2 (zero-based). Lines that do not have enough columns are treated as having an empty value for the sort column and sort to the top.

Removing Duplicates

The Remove Duplicates option keeps only the first occurrence of each unique line after applying sort order. Combined with Ignore Case, it removes case-insensitive duplicates as well. This is commonly used to deduplicate keyword lists, email addresses, URLs, and other text data that may contain repeated entries from different sources.

Common Use Cases

  • Sorting keyword lists for SEO research alphabetically or by length
  • Deduplicating email lists, domain lists, or URL lists
  • Sorting CSS property lists for consistent formatting
  • Alphabetizing bibliography entries or reference lists
  • Numeric sorting of version numbers, prices, or scores
  • Randomizing survey questions or test item order
  • Sorting import statements in code files

Frequently Asked Questions

Paste your text into the input area, make sure the A-Z chip is selected, and the lines will be sorted alphabetically instantly. Use the Ignore Case option to treat uppercase and lowercase letters as equal during sorting.
Check the "Remove Duplicates" checkbox below the input. This will remove any duplicate lines from the output, keeping only the first occurrence. Enable Ignore Case to also remove case-insensitive duplicates (e.g., "Apple" and "apple" treated as the same).
Custom sort mode lets you sort by a specific column within each line. For example, if your lines are comma-separated, you can sort by the second column (index 1). Specify the delimiter (comma, tab, pipe, space) and the zero-based column index.
Yes. The numeric sort mode extracts the numeric value from each line (including decimals and negative numbers) and sorts by that value. Non-numeric lines are treated as zero. Negative numbers sort before positive ones by default.
No. All sorting happens 100% in your browser using JavaScript. Your text never leaves your device. There is no server, no logging, and no data collection of any kind.