sort_by_alpha
Sort Lines Tool Browser-only

Sort Lines Tool

Paste a list and sort it instantly with natural, numeric, or lexicographic order. Combine blank-line cleanup, deduplication, and locale-aware sorting without sending data anywhere.

lock Your text is processed locally in this browser.
edit_note Input
Lines: 0 Chars: 0 Trailing newline: No
Ctrl/⌘ + Enter to sort
Idle Auto update
Ctrl/⌘ + Shift + C to copy output
task_alt Output
Result 0 Duplicates removed 0 Time 0ms
settings_suggest Advanced options
expand_more
Duplicates
Duplicate checks follow the current comparison rules.
Sort locale
Choose a locale for collation without changing the UI language.
Numeric sort details
Example: "item 12" sorts by 12; "v1.2.3" uses 1.2.
Non-numeric lines
When sorting numerically, choose how to place non-numeric lines.
Decimal separator
Auto detection uses a practical heuristic for mixed locale inputs.

How it works

  1. 1

    Paste your list

    Drop newline-separated text into the input area.

  2. 2

    Choose a sort mode

    Natural sort is the default; numeric and lexicographic are one click away.

  3. 3

    Copy or download

    Grab the sorted results instantly or continue chaining.

Examples (click to load)

Click a card to load its input

Sort mode differences

Natural

Uses locale-aware natural sorting so 1, 2, 10 are ordered correctly.

Numeric

Extracts numbers and sorts by numeric value, supporting decimals and exponents.

Lexicographic

Pure string comparison using the selected locale.

Privacy & limitations

  • All processing runs locally in your browser.
  • Very large inputs disable auto update to keep the UI responsive.
  • CSV column sorting is not supported in this tool.

FAQ

Q. How do I sort 1, 2, 10 in the expected order?

Choose Natural sort. It treats number fragments as numbers, so 1 → 2 → 10.

Q. Can I switch ascending or descending?

Yes. Use the Asc/Desc toggle next to the sort mode buttons.

Q. What happens with duplicates?

Duplicates are kept by default. Turn on “Remove duplicates” to keep only the first.

Q. How do I sort file2 and file10 correctly?

Natural sort places file2 before file10.

Q. What about lines that mix text and numbers?

Use “first number in line” or move non-numeric lines to the top or bottom.

All processing is done in your browser. No data is sent to any server.