Skip to main content

Sort Lines by Length

Sort pasted lines by character length in your browser.

Tool workspace

Sorting runs in your browser. Nothing you paste is sent to our servers.

How it works

Paste or type text into the input. The tool splits on line breaks (CRLF, CR, or LF), sorts lines by Unicode character length (code points—the same basis as Character Counter), and joins them with LF.

Choose Shortest first (default) or Longest first. Lines with the same length keep their original relative order. Empty lines have length 0. Empty input produces an empty result—no error. Each line’s exact text is preserved aside from reordering.

Results update as you type (light debounce). Processing runs entirely in your browser.

Examples

  • bbb\na\ncc → a\ncc\nbbb (shortest first)
  • bbb\na\ncc with Longest first → bbb\ncc\na
  • aa\nbb\ncc → aa\nbb\ncc (equal lengths keep original order)

Privacy

Privacy: this tool processes text locally in your browser. We do not log or store what you paste. Login is not required.

FAQ

Is my text uploaded to a server?

No. Line sorting runs entirely in your browser. Pasted content is not sent to Every Tools.

Do I need an account?

No. All published tools work for guests without login.

How is length counted?

Length is Unicode code points (not bytes or UTF-16 code units). Multi-byte characters such as é count as one.