Sort Lines by Length

Orders lines from shortest to longest. Lines with the same length are sorted alphabetically.

Result

The converted text appears here as you type.

For example
strawberry
fig
banana
fig
kiwi
banana

How to use

  1. Paste or type your text in the box.
  2. Check the result. Every change is highlighted, so you can see exactly what will be different.
  3. Press Copy Result, or Open in Editor to keep working with more tools, undo and saved drafts.

Example

Before
strawberry
fig
banana
kiwi
After
fig
kiwi
banana
strawberry

What it's for

  • Finding the shortest headline or keyword in a list
  • Spotting unusually long entries in a data column

Questions

Can I sort longest first?

Sort by length, then run Reverse Line Order.

Related tools