Sort Lines

Free online tool to sort text lines alphabetically. Sort A-Z, Z-A, by length, or shuffle randomly. Natural sort for numbers. Remove duplicates.

settings Settings

About Sort Lines Tool

Sort text lines quickly and easily with multiple sorting options. Perfect for organizing lists, sorting data, arranging names, or randomizing items.

Supports alphabetical sorting (A-Z, Z-A), sorting by line length, natural sorting for numbers, and random shuffling. Additional options include removing duplicates, removing empty lines, and trimming whitespace.

How does alphabetical sorting work?

Alphabetical sorting arranges lines in dictionary order. A → Z sorts from A to Z, while Z → A reverses the order. By default, sorting is case-insensitive unless you enable 'Case Sensitive' option.

What is Natural Sorting?

Natural sorting handles numbers intelligently. For example, it sorts '2' before '10' (unlike alphabetical which puts '10' before '2'). Perfect for sorting filenames, version numbers, or any text with numbers.

What does 'Remove Duplicates' do?

When enabled, duplicate lines are removed, keeping only the first occurrence of each unique line. This happens after sorting.

Can I sort by line length?

Yes! You can sort lines from shortest to longest or longest to shortest based on character count.

How does Random Shuffle work?

Random Shuffle randomly reorders all lines. Each time you click 'Sort', you'll get a different random arrangement. Useful for creating random lists or selecting items randomly.