Sort Lines

Put lines of text in order — alphabetical, numeric, natural or by length, ascending or descending. Optionally drop duplicates and blank lines. Everything runs in your browser.

Sorted lines

About this tool

Sort Lines puts the lines of any text in order — paste a list and choose how it should be sorted.

Everything runs locally in your browser via WebAssembly — your text is never uploaded.

Handy for

FAQ

What's the difference between numeric and natural sorting?

Numeric parses the number at the start of each line (signs and decimals work, e.g. -2.5) and orders lines by that value. Natural compares digit runs anywhere inside the text as numbers, so file2 sorts before file10 while the letters around the digits are still compared as text.

Where do lines without a number go when I sort numerically?

Lines that don't begin with a number are placed after all the numbered lines (and before them when the order is descending), rather than being dropped or causing an error.

Does "Remove duplicate lines" respect the case and whitespace options?

Yes. Deduplication runs after sorting and uses the same comparison key, so with Ignore case on, Apple and apple count as one line, and with Ignore surrounding whitespace on, item and item do too. The first occurrence is kept and the output reports how many duplicates were removed.

Is there a size limit, and does my list leave my device?

There's no fixed line limit — sorting happens locally in your browser through WebAssembly, so even large lists are processed on your machine and nothing is uploaded.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool sort-lines "Paste lines to sort…"

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/sort-lines/?text=Paste%20lines%20to%20sort%E2%80%A6&method=alpha&order=asc&ignore_case=true&trim=true&unique=true&remove_blank=true

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.