Sort Lines
Sort your text lines alphabetically, numerically, by length, or reverse order. Perfect for organizing lists and data.
Paste or Upload Text
Quick Copy
A → Z
Sorted...
Z → A
Sorted...
No Case
Sorted...
Numeric
Sorted...
By Length
Sorted...
Sort your text lines alphabetically, numerically, by length, or reverse order. Perfect for organizing lists and data.
Sorted...
Sorted...
Sorted...
Sorted...
Sorted...
Line sorting is the process of reordering the individual lines of a block of text according to a rule — alphabetically, numerically, by length, or in reverse — instead of leaving them in whatever order they were typed, pasted, or exported in. Each line (everything between one line break and the next) is treated as a single unit and moved as a whole, so the content of every line stays intact while only the sequence changes.
Sorting shows up constantly when working with lists: alphabetizing names, arranging log entries, ordering CSV-style rows, or lining up two lists so they can be compared or diffed. Because it only reorders lines rather than editing their contents, sorting is a safe, reversible-in-spirit operation — nothing about the individual lines themselves is changed.
The Sort Lines tool takes a block of text and instantly produces five different sorted versions of it side by side: ascending (A → Z), descending (Z → A), case-insensitive, numeric, and by length (shortest to longest). Instead of picking one sort order upfront, you get all five at once in the Quick Copy sidebar, so you can preview and grab whichever ordering fits your task.
You can paste text directly, type it in, or upload a .txt or .md file. An optional "Remove Empty Lines" toggle strips blank lines out before sorting, and live statistics show your original line count, sorted line count, empty lines removed, and total character count. Every result can be previewed in a larger modal, copied to your clipboard, or downloaded as its own .txt file — all processed locally in your browser.
Paste your list into the text area, type it directly, or upload a .txt or .md file using the upload panel below the textarea.
Check "Remove Empty Lines" (enabled by default) if blank lines in your text should be excluded from every sorted result and from the line-count statistics.
The stats panel shows your original line count, sorted line count, how many empty lines were removed, and the total character count, updated live as you type.
In the Quick Copy sidebar, each of the five sort orders — A → Z, Z → A, No Case, Numeric, and By Length — is generated automatically and shown with a live preview snippet.
Click "Preview" on any result to open a larger modal view of the full sorted text before deciding which order to use.
Click the copy button next to a result to copy it to your clipboard, or use "Copy & Close" from the preview modal. Download any result as a standalone .txt file if you need a saved copy.
A line like " Banana" (with a leading space) sorts before "Apple" in ascending order, because the space character comes before any letter. Trim stray leading whitespace from your source data if this affects your results.
Numeric sort parses each line with parseFloat, which reads only the leading numeric portion of a line. A line like "7 items" is parsed as the number 7 and sorted alongside pure numbers, which can be surprising if your list mixes plain numbers with numbers embedded in sentences.
When a line can't be parsed as a number, numeric mode falls back to alphabetical comparison for that pair only. In a list that mixes numbers and words, this can produce an order that looks inconsistent rather than a clean "numbers first, then text" grouping.
Text with Windows-style CRLF line breaks leaves a trailing carriage-return character attached to each line after splitting. It won't be visible on screen, but it is technically part of the line and travels with it through sorting, copying, and downloading.
"Remove Empty Lines" is enabled by default, so blank lines in your pasted text are excluded from every sorted result automatically. If you need to preserve blank lines (for example, to keep paragraph breaks), turn this option off first.
Sorting only reorders lines; it does not remove repeated ones. If your list has duplicate entries, sorting will simply place the duplicates next to each other rather than removing them — use a dedicated duplicate-removal tool if you need a unique list.
A mixed-case list of names sorted into natural alphabetical order.
Input
Charlie alice Bob
Output
alice Bob Charlie
A list of numbers, including one line where the number is followed by text, sorted by numeric mode.
Input
10 2 33 7 items
Output
2 7 items 10 33
A short word list ordered from shortest to longest line.
Input
banana kiwi watermelon fig
Output
fig kiwi banana watermelon
No. This tool runs entirely in your browser. Your text never leaves your device or gets sent to a server.
Ascending ("A → Z") uses locale-aware comparison, which already handles most case differences sensibly. "No Case" explicitly lowercases both lines before comparing, guaranteeing that "Apple", "apple", and "APPLE" are always treated as equal regardless of locale quirks.
Numeric mode parses each line with parseFloat, so lines that don't start with a clean number, or that mix numbers with words, can produce an order that isn't purely numeric or purely alphabetical. Check that your list contains one number per line for the most predictable results.
No, sorting only reorders lines — it doesn't remove repeats. Duplicate lines will simply end up next to each other after sorting. Use a dedicated duplicate-removal tool if you need a unique list.
When enabled (the default), blank lines are filtered out of your text before sorting, so they're excluded from every result and from the line-count statistics. Turn it off if you need to keep blank lines in the output.
Yes. All five sort orders — Ascending, Descending, Case-Insensitive, Numeric, and By Length — are generated simultaneously as soon as you enter text, so you can copy or download whichever one you need without re-running anything.
You can upload .txt or .md files. The contents are loaded directly into the text area and sorted the same way as pasted text.