Sort Lines
Sort any block of text line by line — alphabetically, numerically, or by length. Numeric sorting uses real number values, not string order.
Sort order
Processed locally in your browser.
What does this tool do?
The Sort Lines tool takes a block of text and reorders the lines according to the sort mode you choose. It is useful for sorting lists, cleaning up code, organising data, and more.
Sort modes
- A → Z — alphabetical ascending (locale-aware).
- Z → A — alphabetical descending.
- Numeric ↑ — ascending by numeric value. Lines that are not numbers fall back to alphabetical order.
- Numeric ↓ — descending by numeric value.
- Short → Long — ascending by character count.
- Long → Short — descending by character count.
Numeric sorting example
Input: 10 / 2 / 30 / 4
Numeric ascending → 2 / 4 / 10 / 30 (not 10 / 2 / 30 / 4 as alphabetical would give).
Options
- Case-sensitive — uppercase letters sort before lowercase when enabled.
- Remove duplicates — keep only the first occurrence of each unique line.
- Remove empty lines — blank lines are excluded from the output.
How to use
- Choose a sort mode from the buttons at the top.
- Paste your text into the input — one item per line.
- The sorted output appears immediately below.
- Click Copy to copy the result.
FAQ
- What happens to empty lines? By default empty lines are kept but moved to the end of the sorted output. Check Remove empty lines to exclude them.
- Is my text sent to a server? No. All sorting runs locally in your browser.
Privacy
Your text is processed entirely in the browser. Nothing is transmitted to any server.