Sort Lines by Length

Paste a list and sort it by the number of characters in each line, from shortest to longest or the other way around.

🔒 Your files never leave your device. Everything is processed in your browser.

How to sort lines by length

  1. Paste or type your list, one item per line.
  2. Press “Shortest first” or “Longest first”.
  3. Check the result; if it isn't what you wanted, use Undo.
  4. Copy the result.

What is this tool for?

Sorting by length helps you find the longest or shortest texts in a list, check titles that don't fit a character limit, or prepare word lists by size.

The characters in each line are counted. If two lines have the same length, they stay in alphabetical order. Your text never leaves your browser.

Limits to keep in mind

Frequently asked questions

How do I sort a list from the shortest line to the longest?

Paste the list with one item per line and press “Shortest first”. For the opposite order, press “Longest first”.

What happens if two lines have the same length?

They stay one after the other in alphabetical order.

Is my list uploaded to a server?

No. Everything runs in your browser and your text is never sent or stored.

Are spaces counted?

Yes, every character counts, spaces included. You can remove the extra ones with “Trim extra spaces”.