Sort Lines by Length

Arrange all lines by their character length, with the shortest lines first.

Example

Input

Medium line
Short
A much longer line here

Output

Short
Medium line
A much longer line here

How Sort Lines by Length Works

Arrange all lines by their character length, with the shortest lines first.

This tool runs entirely in your browser — no data is sent to any server. Paste your text, click Run, and get your result instantly. You can also chain this tool with others using the pipeline feature: run Sort Lines by Length, then continue with a related tool to build a multi-step text workflow.

TextRefinery is a free, open-source text processing toolkit. Learn more about regular expressions and text processing on the web.