DocumentsImagesMediaPDF Tools

Sort Lines

Sort lines of text alphabetically, numerically, or in reverse order, in your browser.

Processed in your browser — no text sent to any server

Sort any list instantly

Multiple sort modes

Alphabetical, numeric, natural (for names with numbers), and reverse. With or without case distinction.

100% private

Your data is sorted in your browser. Nothing is sent to any server.

Locale-aware sorting

Support for accented characters with each language's rules: ñ, ü, è, ø sorted correctly.

Instant

Results appear as you type. No waiting for lists of any typical size.

Three steps, no hassle

1

Paste the text to sort

Enter the lines you want sorted. It can be a list of names, countries, URLs, keywords, or any line-by-line content.

2

Select the sort type

Choose alphabetical, numeric, natural (for names with numbers like 'file10'), or reverse order. You can also enable case-insensitive mode.

3

Copy the sorted result

Sorted lines appear instantly. Copy to clipboard or download as a text file.

Got questions?

The tool offers four main modes: alphabetical sorting (using Unicode character set order), numeric sorting (interprets content as numbers: 10 comes after 9, not between 1 and 2), natural or 'human' sorting (combines text and numbers so 'file2' comes before 'file10'), and reverse order (applies the inverse of any of the above modes). Natural sorting is especially useful for filenames, software versions, and any list mixing text with numbers.

By default, sorting follows Unicode code point order, where uppercase letters (A-Z, codes 65-90) precede lowercase (a-z, codes 97-122). This means 'Zebra' appears before 'banana' in a standard sort. If you enable case-insensitive mode, comparison is done by temporarily converting everything to lowercase, resulting in a more intuitively human-readable order.

Basic sorting follows Unicode code points, which can produce unexpected results for languages with special characters: in Spanish, 'ñ' would end up at the bottom of the list instead of between 'n' and 'o'. Locale-aware sorting uses the browser's Intl.Collator API, applying the sorting rules of the selected language. For lists in Spanish, French, German, or other languages with diacritical characters, this option produces culturally correct results.

Yes. Reverse order mode inverts the result of any other sort type. If you were applying A-Z alphabetical, reverse gives Z-A. If applying ascending numeric, reverse gives descending. Reverse order is useful for displaying highest values first (scores, prices, most recent versions) or for inverting an already-sorted list without reprocessing it.

In standard alphabetical sorting, numbers are sorted as text: '10' comes before '2' because '1' precedes '2' in the character code. This produces results like: 1, 10, 100, 2, 20, 3. Numeric sorting interprets each line as a numeric value: 1, 2, 3, 10, 20, 100. Natural sorting detects numeric fragments within mixed text strings and compares them arithmetically: 'Version 2' comes before 'Version 10', even though the 'V' and 'e' characters are equal.

Sort lines of text: alphabetization, natural sorting, and data organization in seconds

The need to sort text lists arises in dozens of everyday contexts: sorting customer names for a report, alphabetizing a list of countries for a dropdown, organizing keywords alphabetically for an SEO spreadsheet, or putting a list of prices extracted from a website in ascending order. The operation seems simple but has multiple nuances depending on the data type.

The difference between alphabetical, numeric, and natural sorting is especially important when data mixes text and numbers. Alphabetical sorting treats numbers as text, producing the well-known '1, 10, 2, 20, 3' problem instead of '1, 2, 3, 10, 20'. Natural sorting, implemented by algorithms like Dave Koelle's Natural Sort Order, detects numeric fragments within strings and compares them arithmetically, producing the intuitively correct order for filenames, software versions, book chapters, and similar data.

Convertir.ai implements sorting directly in the browser using JavaScript's V8 engine and the Intl.Collator API for localization support. Your text is never sent to any server. Results are immediate for any typical list size, and locale support ensures that accented characters in Spanish, French, German, and other languages are sorted according to each language's culturally correct rules.