Nylia Text.Text & list tools

Sort lines

Sort Lines Online – Alphabetical & Natural Sorter

Sort text lines alphabetically or naturally, with language-aware ordering and preserved leading zeros.

1 Sort lines
0 / 500,000 characters
Ready when you are

Nylia Text result

Your original input stays unchanged.
Settings links never include your text.

Paste text, choose your options, and run the tool.

How it works

Alphabetical and natural ordering use the browser’s Intl.Collator for the selected language. Natural order compares digit runs numerically. Equivalent comparisons retain their original order.

When to use it

Choose natural order for file names such as item2 and item10. Reverse input order reverses the list without alphabetical comparison.

Good to know

Natural order is not decimal-value or semantic-version sorting. Locale collation can vary with browser Unicode data. Sorting never changes the text of retained lines unless you also select cleanup.

Up to 500,000 characters and 25,000 lines per input. UTF-8 text files up to 2 MB. Review outputs before using them.

CSV protection adds an apostrophe to fields starting with formula-like characters or tab/line-break controls. It changes those values. Protection varies by spreadsheet and may be lost after saving and reopening. Import untrusted data and identifiers as text. Copy or TXT preserves the original values.

Choose the ordering that fits your list

Paste one item per line and choose an ordering mode. A to Z and Z to A use alphabetical collation. Natural ordering handles digit runs in labels, while Reverse input order simply reverses the existing sequence. Choose the language whose sorting rules should apply.

The initial mode is natural sorting. Sorting alone retains each line’s text, including leading zeros. Cleanup settings can change that text, so leave them off when spacing is meaningful.

Example: names containing numbers

In natural order, item2 comes before item10. In ordinary alphabetical order the result can differ because digits participate in text ordering. Entries considered equivalent retain their relative input order.

Natural sorting is useful for simple numbered labels and filenames. It is not a decimal-number calculator or a semantic-version comparator. Language collation depends on your browser’s Unicode data, so validate unusual scripts or punctuation against the ordering you need.

Clean before sorting when needed

Use the text and list cleaner to trim edges, remove blank lines and deduplicate in one workflow. If the only problem is repeated entries, remove duplicate lines first. Copy the result or download TXT when you want to preserve it as plain text.

Frequently asked questions

How do I sort lines alphabetically?

Paste one item per line, choose A to Z for ascending alphabetical order or Z to A for descending order, and select Sort lines. You can then copy or download the result.

What is natural sorting?

Natural sorting compares digit sequences numerically, so item2 comes before item10. Ordinary alphabetical sorting may place item10 before item2.

Can I reverse the original order?

Yes. Choose Reverse input order to reverse your input lines without alphabetizing them.

More about sorting text

Will sorting remove duplicate lines?

No. This sorter keeps repeated entries. To remove them first, try Remove Duplicate Lines.

Can I preserve leading zeros?

Yes. Sorting does not turn identifiers into numbers, so text such as 001 remains unchanged unless an additional cleanup option is enabled. Spreadsheet applications may interpret exported values differently.

Does my text need to be uploaded to a server?

No. Nylia Text processes the content in your browser. Review the privacy policy for details about website analytics and other data handling.