Sort lines

Sort a list alphabetically, numerically, or in natural order.

Your inputs stay on your deviceFREE · NO SIGN-UP
Sort by
Order
Sorting language

Case is ignored; accents follow your language. Choose Natural for file2 before file10. Duplicates and original spacing stay intact. Blank lines move to the end. Up to 10,000 lines and 200,000 characters.

Result

Start typing and the result appears here. No button needed.

THE LITTLE DETAILS

Sort lines, without the extra steps.

Put a pasted list in the order you need while keeping every entry intact. Alphabetical sorting follows your chosen language, natural sorting puts file2 before file10, and numeric sorting compares signed decimal values exactly. The result updates as you type or change an option, ready to inspect and copy.

How to use this tool

  1. 1Paste your list with one item per line; the original stays visible above the result.
  2. 2Choose Alphabetical, Numeric, or Natural, then Ascending or Descending. For text, choose the sorting language.
  3. 3Inspect the live result and select Copy result to paste the ordered list elsewhere.

When Sort lines is the right tool

  • A list of attendees needs alphabetical order, with accented names placed according to the language of the event.
  • Filenames such as chapter1, chapter10, and chapter2 need a natural reading order before you share an index.
  • Signed measurements or long decimal IDs need smallest-to-largest order without losing digits or changing their written form.
  • A copied list includes duplicates, indentation, and blank lines that must remain present after reordering.

Choose the comparison that matches your list

Alphabetical mode compares whole labels using the selected language, which can put file10 before file2. Natural mode treats digit runs inside labels as numbers, placing file2 first. Numeric mode instead requires each nonblank line to be one signed number or dot decimal; it handles negative values and compares large IDs without rounding. Use numeric ordering for measurements and natural ordering for filenames. Neither mode interprets dates, version rules, or spreadsheet columns.

Language changes where accented letters belong

An alphabetical list is not universal: Swedish places å, ä, and ö after z, while German sorts accented vowels alongside their base letters. Choose the language your readers expect rather than relying on the browser's default. Case is ignored, accents remain meaningful, and entries that compare equally keep their original relative order. Original capitalization and surrounding spaces remain in the result. Natural sorting uses the same language rules for the text around digit runs.

Check the list before replacing your source

The input stays visible so you can compare it with the live result. Sorting rearranges entries without trimming their contents or removing repeated values. Blank and whitespace-only lines are collected at the end, even in descending order. If numeric mode finds a heading, a currency symbol, or an unfinished decimal, the message identifies its original line number. Correct that line or switch to natural sorting before copying. Clearing the input clears the old result too.

GOOD TO KNOW

A few quick answers.

No. Every input line is retained, including repeated names, equal numbers, and blank entries. Equal values keep their original relative order even when descending is selected. Use Remove duplicate lines afterwards if each entry should appear only once.

Sorting takes place inside your browser. Your customer names, filenames, or numeric values are not sent to a processing server. Copying is an explicit action so you can inspect the ordered output before replacing a list in another application.

Whitespace-only lines move to the bottom in both directions. Spaces and tabs are ignored when comparing entries but preserved in the output. A final newline counts as a trailing blank entry. Windows and older Mac line breaks are normalized to LF.

Yes. Numeric mode compares decimal digits directly rather than converting the input to floating-point numbers. Adjacent integers above 9,007,199,254,740,991 remain distinct. Leading zeros, plus signs, and trailing decimal zeros stay exactly as pasted; equal numeric values keep their input order.

Commas can mean a thousands separator or a decimal separator depending on the source. This tool does not guess. Use 1200 for one thousand two hundred and 1.2 for a dot decimal. Exponents, currencies, and unit suffixes are also rejected with a line number. Natural mode accepts them as labels, but does not calculate their numeric meaning.

This tool compares the whole trimmed line. It does not split names into given names and surnames, or parse CSV fields and quoted multiline records. Prepare a single-column list with the desired comparison text first when you need one of those workflows.

Back to all tools