Sort Lines
Put a list in alphabetical, natural, length or random order without leaving the page.
- lines
- 1
Output
Paste or type above to see the result here.
Your files stay on your device
This tool runs entirely in your browser. What you paste is processed on your device and is never sent to a server, so it is safe to use with tokens, keys and unpublished text.
How it works
- Paste the lines you want to sort, one item per line.
- Choose the order. A to Z and Z to A are plain alphabetical; Natural sorts numbers inside text by value so item2 comes before item10; By length sorts shortest to longest.
- Turn on Ignore case so that apple and Banana sort together regardless of capitalisation, and Remove duplicates if you also want a unique list.
- Press Sort lines and copy the result. Reverse and Shuffle ignore alphabetical order and simply flip or randomise the current sequence.
Frequently asked questions
- What is natural sort order?
- Natural order compares runs of digits by numeric value instead of character by character, so file1, file2, file10 come out in that order rather than file1, file10, file2. It is what you want for file names, version numbers and numbered lists.
- How are accented and non-English characters sorted?
- Sorting uses the browser's locale-aware comparison (Intl.Collator), so é sorts next to e and Japanese kana and kanji are ordered by code point in a stable, predictable way. Results can differ slightly between browsers and system locales.
- Is the sort stable?
- Yes. Lines that compare as equal, for example with Ignore case on, keep their original relative order. Sorting by length also keeps the original order among lines of the same length.
- How random is Shuffle?
- Shuffle uses a Fisher-Yates shuffle with the browser's cryptographic random source, so every permutation is equally likely. It is suitable for picking a random order for names or questions.
- Is my list sent to a server?
- No. Sorting runs entirely in your browser. Nothing is uploaded or logged.
Related tools
• Remove Duplicate Lines Paste a list and keep only the first occurrence of each line, in the order you pasted it. • Word Counter Live word, character, sentence and paragraph counts for essays, posts, ads and anything with a length limit. • Case Converter Switch between UPPER, lower, Title, Sentence, camel, Pascal, snake and kebab case in one click. • Text Diff Paste two versions of a text and see exactly which lines changed.