Skip to content

Sort Lines

Sort any list alphabetically, by length or by number.

How to use the sort lines

Three steps, all in your browser.

  1. 1

    Add your text

    Type, paste or open a .txt file. Press Sample to try an example.

  2. 2

    Choose the order

    Pick an order or format. The result updates live.

  3. 3

    Copy or download

    Copy the result in one click or save it as a .txt file.

Sort Lines: what to know

Sort Lines puts the lines of your text in order: A to Z, Z to A, natural order (so 'item 2' comes before 'item 10'), shortest first, longest first, or simply reversed.

Sorting is language-aware: accented letters sort next to their base letter instead of after Z. 'Ignore case' (on by default) keeps 'apple' and 'Apple' together; turn it off for computer-style ordering where capitals come first.

Options remove empty lines, remove duplicates and trim spaces from each line, so you can clean and sort a list in one pass. Lines are compared as whole lines, so sorting 'Smith, John' style entries sorts by surname.

Popular uses

  • Ordering lists of names, products or keywords
  • Sorting file names and versions in natural number order
  • Ranking lines by length for headlines or slogans
  • Reversing a log so the newest entries come first

Tips for the best result

  • Use natural order whenever lines contain numbers.
  • Turn on 'Remove duplicates' to clean and sort a list at once.
  • For a quick alphabetical list of names, the Alphabetize List tool has a few extra options.

Read how JustYourText works and our privacy details. Text you type or paste is processed in your browser and is never sent to our server.

Frequently asked questions

Natural order sorts numbers by their value, so 'item 2' comes before 'item 10'. Plain A to Z compares character by character and puts 'item 10' first.

With 'Ignore case' off, capitals sort before lowercase letters, as in computer (ASCII) order: 'Zebra' comes before 'apple'. With it on, 'apple' and 'Apple' sit together.

No. Every tool runs in your browser, so the text you type or paste is processed on your device and is not sent to our server or stored. Reloading or closing the page clears it.

Yes. Every tool is free with no sign-up and no limits on use. Clearly labeled ads keep it that way.

Yes. The tools work in any modern browser on phones, tablets and computers. Copy and Download work on mobile too.