Choose by the data you have
| Method | Best fit | Watch for |
|---|---|---|
| SortLines | Paste, configure, review and copy | Browser memory and device limits |
| GNU sort | Files and repeatable scripts | Locale and option differences across systems |
| VS Code | A selection already in a text file | Sort Lines Ascending is alphabetical |
| Excel | Tables with linked columns | Sort the entire table so rows stay aligned |
Sort a pasted list online
Open Sort Lines, paste one item per line, choose a mode and review cleanup changes. Use Natural sort for file2/file10 or Numeric sort for complete numeric values. Then copy or download the output.
Sort files with GNU sort
sort input.txt > sorted.txt
sort -g numbers.txt > numbers-sorted.txt
sort -r input.txt > descending.txt
sort -u input.txt > unique-sorted.txt
sort -V filenames.txt > filenames-sorted.txtThese examples target GNU Coreutils. -g compares general numeric values, -r reverses the ordering, -u emits unique comparisons and -V uses version sorting. Version sorting and this site's locale-aware natural sorting need not produce the same result. Use a different output filename: redirecting into the input file can truncate it before sorting.
Sort selected lines in VS Code
Select the complete lines, open the Command Palette and run Sort Lines Ascending or Sort Lines Descending. These commands do not provide the same numeric or cleanup controls as this tool.
Keep spreadsheet rows together
In Excel, select the full table and use Data → Sort on the intended column. Sorting only one column can disconnect a name from its associated email or ID. For a standalone pasted column, a line sorter is sufficient.
Sources and further reading
GNU Coreutils: sort invocation · VS Code: built-in line operations · Microsoft: sort data in a range or table