ToolConvoyToolConvoyv2.6
TEXT

Sort Lines — Sort Text Lines Alphabetically A-Z or Z-A

Sort text lines alphabetically A-Z or Z-A. Numeric sort, random shuffle, reverse — runs in your browser, no upload.

● LOCAL · CLIPBOARD-FRIENDLY0 network requests since page load

Sort Lines

Sort text lines alphabetically (A-Z or Z-A). Works entirely in your browser.

Sorting lines is the most basic text operation in computing and the one that reveals the most about how a list was assembled. An unsorted list of email addresses sorted alphabetically reveals duplicates that were invisible in the original order. A log file sorted by timestamp reveals patterns in the event sequence. A configuration file sorted by key makes it easier to find a specific setting. The line sorter does one thing — sort lines — and the simplicity of the operation is its value: paste, sort, copy, done.

The distinction between alphabetical and numeric sort is the one that causes the most silent errors in manual sorting. Alphabetically, the list 1.txt, 10.txt, 2.txt is correct because 1 comes before 2 in character-by-character comparison. Numerically, the same list should be 1.txt, 2.txt, 10.txt because 10 is a larger number than 2. The numeric-sort toggle handles this by extracting the leading number from each line and comparing the numeric values rather than the character sequences. This is the same problem that file managers solved with natural sort in the 1990s, and the sorter exposes it as a single toggle.

The locale-aware sorting option is for the multilingual reality that most text sorter tools ignore. Characters like é, ñ, and ü have defined sort positions in their respective languages that differ from their Unicode code-point order. The Intl.Collator-based sort respects the browser’s locale settings and sorts accented characters where a native speaker would expect them, not where the Unicode Consortium assigned their code points. This matters for any list that contains names, places, or words in languages beyond English.

How to use

  1. Paste your text

    Paste or type multi-line text into the input. The tool sorts all lines using the chosen criteria and displays the result instantly. Line count statistics update to confirm no lines were lost.

  2. Choose a sort mode

    Alphabetical A-Z (default) or Z-A. Toggle numeric sort to sort by leading numbers (2.txt before 10.txt instead of the alphabetical order 10.txt, 2.txt). Toggle case-insensitive to treat uppercase and lowercase equally.

  3. Copy or download the result

    Copy the sorted text to your clipboard, or download it as a .txt file. The original input is preserved in a separate panel for comparison — the sort is a non-destructive operation.

Frequently asked

How does numeric sort work?

Numeric sort extracts the leading number from each line and compares lines numerically rather than lexicographically. Leading zeros are handled correctly: 002 sorts before 010. Lines without a leading number are treated as having a prefix value of zero, which places them before numbered lines in ascending sort.

What happens to blank lines during sorting?

By default blank lines sort to the top (or bottom in descending sort). Toggle 'strip blank lines' to remove them entirely, or 'sort blank lines to end' to keep them in the output but move them to the end regardless of the sort direction.

Does the sort respect locale-specific ordering?

The default sort follows Unicode code-point order, which places accented characters after the base ASCII range. Toggle locale-aware sorting (using the browser's `Intl.Collator`) to sort according to the user's locale — e.g., in French, é sorts as e, not as a separate character.

Can I sort by a specific column or field?

No — the tool sorts entire lines. For column-based sorting (e.g., sorting a CSV by the second column), use a spreadsheet tool or pre-process with a script. The line sorter is for flat text lists where each line is a self-contained entry.

What is the maximum file size the sorter can handle?

The sorter handles files up to the browser tab's available memory — typically hundreds of thousands of lines. For million-line files, the sort may take a few seconds. The sort algorithm is a stable sort (lines with equal keys preserve their relative input order), which is useful for multi-pass sorting.

Limitations

  • Full-line sorting onlyColumn-based and field-based sorting are not supported. For sorting by a specific delimited field (CSV, TSV, fixed-width), use a spreadsheet tool or a command-line utility like `sort -t, -k2`.
  • No natural sort for mixed alphanumericMixed alphanumeric values like 'item2' and 'item10' are sorted lexicographically: 'item10' before 'item2'. Toggle natural sort to treat embedded numbers as numbers, producing the human-expected order 'item2, item10'.
  • Encoding assumed UTF-8Non-UTF-8 inputs may produce unexpected sort order if the same character is encoded differently in different parts of the file. For legacy encodings, convert to UTF-8 first.

Platform notes

macOS
For command-line sorting, `sort input.txt` does alphabetical, `sort -n` does numeric. The browser tool adds the interactive mode toggle and the locale-aware sorting option.
Linux
The standard `sort` command with `-n` (numeric), `-r` (reverse), and `-f` (case-insensitive) covers the same options. The browser tool is the right pick for interactive sorting of text pasted from a chat or email.
Web
Runs entirely client-side. Works offline once loaded.