Any file. Any shape.

Sort Text Lines

Sort your lines alphabetically, by length or by number — privately, right in your browser.

Sort by
Order
Result

How it works

Paste any list — names, URLs, numbers, log entries — pick a sort mode and order, and the lines re-sort live as you type or toggle. Alphabetical mode compares lines as text (with an optional case-sensitive switch), "By length" sorts shorter lines before longer ones (or the reverse), and Numeric mode reads the leading number off each line — "12. Task" sorts as 12 — putting any line that doesn't start with a number at the end, regardless of the chosen order. You can also remove duplicate lines and blank lines as part of the same pass.

Everything runs locally in your browser tab — no upload, no size limit beyond what your browser tab can comfortably hold.

FAQ

What does "Numeric" sort mode do with lines that have no number?

Each line is sorted by the number at its start (e.g. "12. Item" sorts as 12). Lines that don't begin with a number are placed after all the numbered lines, regardless of ascending or descending order, and are ordered alphabetically among themselves.

Is sorting stable — do equal lines keep their relative order?

Sorting uses the JavaScript engine's built-in sort, which modern browsers implement as a stable sort, so two identical or equal-ranked lines keep the order they had in your input.

Can I remove duplicates and sort at the same time?

Yes — enable "Remove duplicates while sorting" and repeated lines are dropped (keeping the first occurrence) before the remaining lines are sorted.

How does "Sort by length" break ties between lines of equal length?

Lines of equal length keep their original relative order (a stable sort), so it reads predictably rather than shuffling equal-length lines around.

Is my text uploaded anywhere?

No — sorting happens entirely in your browser tab. Nothing is transmitted or stored.