Sort Lines
Sort lines of text, with natural and random ordering
What is Sort Lines?
A line sorting tool orders text four ways — ascending, descending, by length, and shuffled — with an option to ignore case and a natural sort mode that puts item2 before item10. Chinese characters are compared by pinyin rather than by code point. Sorting happens locally in your browser.
How to use Sort Lines
- 1Paste your content with one item per line.
- 2Pick a sort mode, and switch on natural sort when the lines contain version numbers or numeric suffixes.
- 3Copy the result.
Frequently asked questions
What is natural sort order?+
Plain lexicographic sorting compares character by character, so it places item10 before item2 because "1" sorts before "2". Natural sort treats each run of digits as a number instead, giving you the intuitive item2, item10 ordering. Turn it on for filenames, version numbers, and anything else with an embedded counter.
How is Chinese text sorted?+
By pinyin, using the browser Intl.Collator with the zh-Hans-CN locale. That matches how Excel sorts Chinese and is what Chinese readers expect. Sorting the same list by raw Unicode code point instead produces an order that looks essentially random to a human.
Related tools
All toolsText Diff Checker
Compare two blocks of text line by line, optionally ignoring whitespace
JSON Diff
Compare two JSON documents structurally, by key path
Regex Tester
Test regex matches live and inspect every capture group
Case Converter
Convert identifiers between camelCase, snake_case, kebab-case, and more
Word Counter
Count words, characters, lines, and estimated reading time
AI Token Counter
Count AI tokens and estimate what a call will cost