Sort Lines

Put a list in order alphabetically, by length or by number, reverse it, or shuffle it. Useful for tidying lists of names, keywords or settings before comparing them.

Sort Lines

Text Tools

Runs locally in your browser.

About the Sort Lines

Organizing unordered, unformatted data presents a common challenge in digital work. Sorting PHP arrays, CSS class lists or template variables by hand is a poor use of time. Even a small typo or extra space can wreak havoc on standard alphabetical sorters

The Sort Lines tool lets you sort lists with custom sort orders and formatting options. Your lists are sorted in your browser and are not uploaded.

Key Features of Sort Lines

  • Custom Sort OrdersTake control of your sort order with the ‘Sort order’ option in the dropdown menu. This lets you sort lists alphabetically from A → Z (ascending) with the click of a button
  • Advanced Case HandlingSort case-sensitive lists by adding parameters in the ‘Case handling’ dropdown menu
  • Built-in List CleaningSimultaneously sort and trim lists by checking the ‘Trim whitespace’ and ‘Remove empty lines’ boxes
  • 100% Local ProcessingKeep your data safe and secure. A trust badge reminds you that the tool only works locally in your browser to protect your lists and other data structures
  • Instant Export OptionsSave time by using the dedicated ‘Sort’, ‘Copy’, and ‘Download’ buttons or hit ‘Clear’ to start fresh

How to Use Sort Lines

  1. Paste your text list into the main ‘Your text (one item per line)’ textarea
  2. Pick your preferred sort order from the dropdown menu
  3. Use the ‘Case handling’ dropdown menu to determine how the tool should sort case-sensitive lists
  4. Hit the ‘Trim whitespace’ and ‘Remove empty lines’ boxes to sort and trim your lists simultaneously
  5. Click the purple ‘Sort’ button to sort your lists alphabetically or numerically
  6. Use the dedicated ‘Copy’ and ‘Download’ buttons to sort and save your text lists in seconds

Sort Lines Examples

A short list sorted with the default options.

Input
pear
apple
mango
banana
Result
apple
banana
mango
pear

Sort Lines — Frequently Asked Questions

How does case-sensitive sorting work?
In a case-sensitive alphabetical order, uppercase letters always come before lowercase letters. This means that words and characters such as ‘Apple’ come before ‘banana’ when using a standard ASCII table. Using the case-insensitive option lets you sort lists with a combination of uppercase and lowercase letters as if all items are lowercase.
Why should I trim whitespace before sorting?
Whitespace at the beginning of a word or phrase has ASCII values that come before letters ‘A’ to ‘Z’. This means that extra space at the beginning of a word will make it appear at the beginning of your list. Using the ‘Trim whitespace’ function helps the tool sort your lists based on letters rather than spaces.
Is my data safe when using this tool?
Yes, your data is safe and protected. The Sort Lines tool only works in your browser. This means that no text lists, arrays, or other data structures leave your device when you hit the ‘Sort’, ‘Copy’, or ‘Download’ buttons. Everything happens locally in your browser for your security and privacy.