📑 Line Sorter

Sort lines with natural, numeric, or case-insensitive ordering. Great for filenames and numbered lists — instant, in-browser, no upload.

About the Line Sorter

The line sorter focuses on three ordering strategies tailored for line-based input: natural sort (which arranges embedded numbers as humans would expect — file2 before file10), numeric sort (sorts by the leading number on each line), and case-insensitive sort. Choose ascending or descending order.

Natural sort is ideal for filenames, version strings, and any list where humans would expect numeric segments to compare by value rather than digit-by-digit. Numeric sort is great for ranked lists where each line begins with a number, while case-insensitive sort brings apple and Apple together regardless of case.

How it works

  • Natural — Splits each line into alternating text/number chunks and compares chunk by chunk, parsing digit runs as integers so 2 < 10.
  • Numeric — Reads the leading number (integer or decimal, optional sign) on each line as the sort key; lines without a number sort last.
  • Case-insensitive — Compares lines using their lowercased forms, so case differences don't affect order.

How to use the line sorter

  1. Paste your text (one item per line) in the input box.
  2. Pick a Mode (natural, numeric, or case-insensitive) and an Order.
  3. Click Sort Lines, then Copy the result or Clear to start over.

Frequently asked questions

What's the difference between natural and numeric sort? Numeric uses only the leading number; natural considers the entire line and compares embedded numbers as values within surrounding text.

How are empty lines handled? Empty lines are kept and sort as empty strings (typically first in ascending, last in descending).

Does it upload my text? No. All sorting happens locally in your browser. Your text never leaves your device.

Does natural sort support decimals and versions? It treats each run of digits as an integer, so 1.10 sorts after 1.2 in numeric value. For dotted version sort, pre-format lines if needed.