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
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
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.