Input

or drop a file here, or paste code below

0 lines · 0 characters

Result

0 lines · 0 characters · 0 lines sorted

Files never leave your browserHow?

Alphabetize a list, sort numbers and sort by column

This tool sorts the lines of a text alphabetically, naturally, numerically, by length or at random. Paste a list, pick the order and the language rules, and copy the sorted result.

Last updated:

How it works

  1. Add your list

    Paste one item per line, open a text or CSV file, or load it from a URL.

  2. Choose the order

    Alphabetical, natural, numeric, by length or random; ascending or reversed; optionally by the Nth column of each line.

  3. Copy the result

    The sorted list appears instantly. Copy it, download it, or use it as the input for another pass.

Features

  • Language-aware alphabetical order

    Sorting uses the Unicode Collation Algorithm through Intl.Collator. Pick the language: in Swedish å, ä and ö come after z, in German ä sorts with a, in Spanish ñ follows n. Code point order (like sort in the C locale) is available too.

  • Natural sort

    Numbers inside text are compared by value, so "item 2" comes before "item 10" and file names sort the way people expect.

  • Numeric sort

    Lines are ordered by the first number they contain, including negatives, decimals and thousands separators such as 1,234.5. Lines without a number go to the end.

  • Sort by column

    Order CSV, TSV or log lines by any field, split by a separator you choose or by whitespace.

  • Clean-up in the same step

    Remove duplicates and empty lines, ignore leading spaces, and choose whether upper and lower case sort apart.

Limits & privacy

Lists and files can be up to 200 MB. Sorting needs the whole list in memory; large files are sorted in a background worker and the result is downloaded as a file. Text up to 256 KB is sorted on every keystroke.

Sorting is stable: lines that compare equal keep their original order. Numeric sorting reads the first number of a line (or of the chosen column); a comma followed by three digits is a thousands separator, any other comma is a decimal comma.

Your list is processed in your browser and never uploaded. See the privacy page.

FAQ

How do I sort a list alphabetically?

Paste the list with one item per line. Alphabetical order is the default; turn on Reverse for Z to A.

Why does item 10 come before item 2?

Plain alphabetical sorting compares character by character, and "1" is smaller than "2". Choose Natural to compare the numbers by value.

How are accented letters sorted?

By the rules of the language you select. In English é sorts with e; in Swedish å, ä and ö are separate letters after z. The tool uses your browser's Unicode collation data, not a home-made table.

Can I sort by the second column of a CSV?

Yes. Set By column to 2 and the separator to a comma (or \t for tab-separated data). Quoted fields that contain the separator are not parsed as CSV, so use a CSV tool for those files.

Are upper-case words sorted first?

Not by default: case is ignored and equal words keep their input order. With Case sensitive on, capitals sort before lower case in the same position.

Can I sort lines randomly?

Choose Random order. For seeds, groups of lines or picking a random sample, use Shuffle Lines.

Related tools