Spincrus

Tools › Sort Lines

Sort Lines

Free online tool to sort lines of text A–Z or Z–A, by number or by length. Also reverse or shuffle a list, trim spaces and drop empty lines.

Runs in your browser. Nothing is uploaded.

Use it from code

The same function is available as an API endpoint. Free tier: 100 calls per day without a key. Pro lifts the limit.

curl -X POST https://spincrus.uz/api/v1/tools/sort-lines \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_KEY" \
  -d '{"text":"pear\nApple\nbanana\n\ncherry","removeEmpty":true}'

FAQ

How do I sort a list alphabetically?

Paste the list with one item per line and keep the mode on "alphabetical". Lines are ordered A to Z; tick "Descending" for Z to A. Upper and lower case are treated alike unless you turn on "Case sensitive".

Why does "10" come before "2" in alphabetical order?

Alphabetical sorting compares characters one by one, so "1" sorts before "2". Use the "numeric" mode to order lines by the first number found in each line; lines without a number are placed at the end.

Can I sort by line length or shuffle the list?

Yes. "length" puts the shortest lines first (longest first when descending), "reverse" flips the current order, and "shuffle" mixes the lines into a different order.

Related tools