Sort lines

Sort alphabetically, naturally, numerically, by length, or in reverse order.

FreeNo pass requiredNo ads

Your text and files stay in your browser.

Drop a file here, or use Open file. Ctrl+Enter / Command+Enter runs the tool.

Ready for your input
Processed on your device

Paste text or try an example to begin.

No uploads. No ads. No Data Pass required. Buy me a coffee

Put a list in the order you need

Sort lines of text using natural ordering, alphabetical ordering, numerical value, or line length, or reverse their existing order. Natural sort is the default, so numbered labels such as item2 and item10 follow the order most people expect.

Sorting examples with different orders

Natural order for numbered labels

Input

item10
item2
item1

Result

item1
item2
item10

Choose Natural to compare digit sequences within text as numbers. This is useful for numbered filenames, chapter labels, and product names. Ordinary alphabetical ordering can place item10 before item2 because it compares the text differently.

Numeric order for signed decimals

Input

10
-2
1.50
1.05

Result

-2
1.05
1.50
10

Choose Number: low → high. Every remaining line must be a number; values keep their original spelling, including the trailing zero in 1.50. Remove currency symbols and thousands separators before using numeric sorting.

Reverse a deliberate sequence

Input

first
middle
last

Result

last
middle
first

Choose Reverse original order when the current sequence matters. It flips the existing list rather than sorting it alphabetically from Z to A. Cleanup still runs first, so disable trimming or blank removal if you need them preserved.

How to sort a column of text

  1. Paste one value on each line or open a text file. To sort a spreadsheet column, copy only the values you want to reorder.
  2. Choose the order in Tool options. Use a numeric mode for numbers alone and natural order for text labels containing numbers.
  3. Set trimming, blank removal, case comparison, and optional duplicate removal. Check the result before replacing your original list.
  4. Copy the sorted output or download a text file. Use output as input to join the sorted values with the comma separator tool.

Questions about sorting lines

What does natural sort mean?

It recognizes number-like sequences inside labels, placing item2 before item10. Natural order is useful for lists people read. If your values are all signed numbers or decimals, choose a numeric order instead for numerical comparison.

Will sorting change large numbers?

Numeric sorting compares decimal values without rounding them through JavaScript's ordinary floating-point number representation. The output retains each original number string. Invalid numeric lines produce an error rather than being assigned a guessed position.

Does the list leave my browser?

No. Sorting happens locally, including when you open a file. The tool does not upload the values for comparison, and it has no ads or Data Pass requirement. Copying and downloading the result are under your control.

What are the size and ordering limits?

Use up to 10 MiB of input and 250,000 values. Alphabetical and natural ordering use the browser's English collator, so unusual punctuation or accented characters can have browser-dependent ordering. Review such lists if a particular external collation is required.

Sorting text is not sorting spreadsheet rows

Each line moves independently. To keep multi-column records together by a chosen field, sort the table in a spreadsheet or database.