Sort Lines

Sort lines of text alphabetically, numerically, in reverse order, or shuffle them randomly.

Processed in your browser. No data is sent to our servers.

How to Sort Lines of Text

Paste your text into the input area with one item per line, then click one of the sort buttons. Sort A-Z arranges lines in ascending alphabetical order. Sort Z-A reverses the order. Sort Numeric interprets each line as a number and sorts from smallest to largest, which is useful for sorting numeric data, IDs, or measurements. Reverse flips the current line order without alphabetizing. Shuffle randomizes the order, which is great for creating random selections or shuffling quiz questions. You can also enable the case-insensitive toggle to ignore letter case when sorting alphabetically, so 'banana' and 'Banana' are treated equally.

Practical Uses for Line Sorting

Sorting lines is one of those simple operations that comes up constantly. Developers sort import statements, dependency lists, and configuration entries to maintain clean codebases. Writers sort glossary terms, bibliography entries, and keyword lists. Data analysts sort exported columns to find patterns, duplicates, or outliers. The Shuffle option is popular for randomizing lists of names for team assignments, drawing winners from a list, or reordering flashcards for study sessions. Combined with the Remove Duplicates tool, you can quickly clean and organize any list. Since the tool runs entirely in your browser, it handles large lists quickly without any server round-trip.

Frequently Asked Questions

Numeric sorting parses each line as a number and sorts by value. Lines that are not valid numbers are placed at the end. This correctly sorts '2' before '10', unlike alphabetical sorting which would put '10' first.

The shuffle uses the Fisher-Yates algorithm with Math.random(), which produces a statistically uniform shuffle. It is suitable for casual randomization but not for cryptographic purposes.

This tool sorts entire lines. If you need to sort tabular data by a specific column, consider using a spreadsheet application or the JSON/CSV conversion tools.

There is no hard limit. The tool runs in your browser, so performance depends on your device. Most modern browsers handle tens of thousands of lines without issues.