Sort Lines
Sort lines alphabetically.
Sort lines alphabetically.
How to use Sort Lines
- Paste your list of lines into the box
- Choose alphabetical, numeric, reverse, or shuffle order
- Toggle case-insensitivity, trimming, or removing blank lines
- Copy the reordered result with one click
About Sort Lines
Sort Lines reorders any list you paste, right on the page. Choose alphabetical order A→Z or Z→A, numeric order so 2 lands before 10 instead of after it, reverse the current top-to-bottom order, or shuffle every line into a random order using a fair Fisher–Yates algorithm. A case-insensitive toggle lets "apple" and "Apple" sort together, while "trim whitespace" and "remove blank lines" clean the list before it sorts, and one click copies the finished result.
Because it runs entirely in your browser, there's no editor command to memorize — you don't need Vim's :sort, a VS Code sort-lines extension, or any install to alphabetize a list online. Paste your text lines, pick an order, and read the sorted output instantly, whether that's a handful of rows or a long list. It's handy for tidying names and email addresses, alphabetizing tags, ordering import statements, sorting keyword or word lists, or arranging any pile of lines you'd rather not put in order by hand.
Everything happens locally in JavaScript, and it's free with no sign-up, no limits, and no watermarks. Your text is never uploaded to a server, so your lists stay private on your own device, and the tool keeps working offline once the page has loaded.
Frequently asked questions
- Is the line sorter free to use?
- Yes, it is completely free with no account, no sign-up, and no usage limits. You can sort as many lists as you like, as often as you like.
- How do I sort lines alphabetically online?
- Paste your lines into the box and choose A→Z for ascending or Z→A for descending alphabetical order. Turn on the case-insensitive option if you want capitalized and lowercase words to sort together, then click copy to grab the reordered list.
- How do I sort text lines without installing anything?
- This tool runs in the browser, so there's nothing to download or set up — just paste your text lines, pick a sort order, and the reordered list appears at once. It works on any device with a browser, including phones and locked-down work machines.
- How does numeric sorting work?
- Numeric sort reads the number at the start of each line and orders lines by their value, so 2 comes before 10 (unlike alphabetical sorting). Lines that don't start with a number are kept in their original order at the end of the list.
- Can I sort lines by length?
- Sorting by line length isn't one of the current modes — the tool sorts alphabetically, numerically, in reverse, or at random. Numeric sort does read the number at the start of each line, so if your lines begin with a length or count, they'll order by that value.
- Can I reverse the order of my lines or sort Z→A?
- Yes. Pick Z→A for descending alphabetical order, or use Reverse to flip the list exactly as it stands, top line to bottom, without alphabetizing it. Reverse is useful when your lines are already in the order you want, just backwards.
- What does the case-insensitive option do?
- When enabled, uppercase and lowercase letters are treated the same during alphabetical sorting, so 'apple' and 'Apple' sort together instead of grouping all capitalized words separately.
- Can I remove blank lines and extra spaces while sorting?
- Yes. Turn on 'Trim whitespace' to strip leading and trailing spaces from every line, and 'Remove blank lines' to drop any empty lines. Both options apply before the list is sorted.
- How is the shuffle random?
- Shuffle uses a Fisher–Yates algorithm powered by your browser's cryptographic random number generator, giving a genuinely unbiased random order. Click Shuffle again to reshuffle the same list.
- How do I sort lines in Vim?
- In Vim you run :sort to sort the whole file alphabetically, :sort! to reverse it, or :sort n for numeric order; to sort only part of the file, visually select the lines first and run :'<,'>sort. If you'd rather not remember the command, paste the lines here and pick an order instead.
- How do I sort lines in VS Code?
- VS Code has built-in 'Sort Lines Ascending' and 'Sort Lines Descending' commands in the Command Palette (F1, or Ctrl/Cmd+Shift+P); select the lines you want to reorder first, or run it on the whole file. This online sorter is a quick alternative when you're not in the editor or want extra options like shuffle and remove-blank-lines.
- Is my data uploaded or stored anywhere?
- No. All sorting, reversing, and shuffling happens locally in your browser using JavaScript. Your text never leaves your device and is never sent to or stored on any server.