Sort Lines
Sort list lines alphabetically, numerically or by length.Text ToolsSort Lines
Sort the lines of a list alphabetically, numerically or by length. Collation follows your locale, so accented characters sort naturally.
About this tool
Package lists, dependency names and CSV fragments all end up needing a sort. Collation is locale-aware so accented words land where a human expects, and numeric mode sorts by the leading number instead of the text.
How to use the Sort Lines tool
- Paste your lines. One item per line; blank lines sort as empty strings.
- Choose an order. Ascending, descending, or by line length, with numeric and case-sensitive toggles.
- Copy the result. The sorted output appears as you change the settings.
Supported formats
Input
- Plain text, one item per line
Output
- Sorted lines
Inputs are validated before anything is processed. Invalid values and unsupported files are rejected with a clear error instead of failing silently.
Frequently asked questions
How does numeric mode work?
Each line's leading number is parsed and used as the sort key; lines without a number sort after the numbered ones.
Is the collation locale-aware?
Yes. Intl.Collator handles accented characters naturally unless you force case-sensitive comparison.
Can I sort by length?
Yes, ascending length, with ties broken alphabetically.
Are duplicate lines removed?
No. Sorting keeps every line; use Remove Duplicate Lines first if you need a clean set.
Privacy
Everything you enter stays in this browser tab. There is no upload endpoint for tool inputs, no account, and no server-side copy of your text or files. Results are produced locally and disappear when you close the page.
No account is required and no file is ever uploaded. See the privacy policy for details about analytics and the limited data this site stores.
Known limitations
- No natural (human) sort for embedded numbers in the alphabetical mode; use the numeric toggle for leading numbers.
- Blank lines are sorted as empty values, not dropped.
- Sorting is stable, so equal lines keep their original relative order.
Related tools
Other free tools from the same collection.