Sort Lines by Length

Put the shortest lines first and the longest last. Length mode is selected; equal-length lines retain their input order.

Find short labels and long text entries

Length sorting is useful when reviewing product names, labels, search phrases or unusually long entries in a spreadsheet export. This tool counts Unicode code points, rather than bytes or the on-screen width of a line.

Example: input and output

watermelon
fig
kiwi
pear
fig
kiwi
pear
watermelon

Use Load sample in the tool to try this example.

Rules and limits

An emoji sequence or an accented letter with a separate combining mark can contain several code points. Spaces count unless trimmed. Turn off Trim lines to include surrounding whitespace. This mode sorts shortest to longest.

Questions and answers

What happens to lines with the same length?

They keep their original relative order.

Are emoji counted as one character?

A single Unicode code point counts as one. Combined emoji and combining marks can contribute several code points.

Is my text uploaded?

No. Processing happens locally in your browser. No account is required. Settings links share options, not your text.