AnyFormat

00 Utility

Sort Lines

Natural sort by default, so item10 comes after item9.

01Input
02Output
03Options 6
  • No upload The conversion runs in this tab. Your file never travels — not to us, and not to the advertising.
  • No sign-up, no email, no daily cap There is no account system to sign up to.
  • No size limit we invented Only your device's memory — about ~2 GB on a desktop browser, ~400 MB on a phone.
  • Turn your Wi-Fi off and convert anyway The conversion needs nothing but this page. Ads will not load without a connection; your file will still convert. That is the whole claim, and it takes five seconds to check.

Sorts lines with a natural ordering by default, which is the one people actually mean: item9 before item10, not after it.

Natural versus alphabetical

A plain alphabetical sort compares character by character, so item10 sorts before item9 because 1 comes before 9. That is correct and it is never what anyone wants.

Natural sort reads runs of digits as numbers, giving item1, item2, item9, item10. This is what file managers do, and it is the default here. Use Numeric value instead when every line is a number and you want them compared as such — it also handles negatives and decimals correctly.

Case sensitivity

Case-insensitive is the default, so Apple and apple sort together. Turn it on for a case-sensitive sort, which puts every capitalised line before every lowercase one — occasionally what you want for code, rarely for anything else.

Sorting is not one operation once accents are involved

A plain sort orders by code point, which puts every capital letter before every lowercase one and drops accented characters after z — so Zoe, apple, Ather is a correct code-point sort and a useless list. The alphabetical option uses your browser's locale-aware comparison instead, which is why a and ather sort together in English but not in Swedish, where a is its own letter at the end of the alphabet. If you need a result that is identical on every machine, code-point order is the one that never varies.

Other names for this

Also searched as “alphabetize lines”, “sort text online”, “line sorter”.

Questions

Why did item10 end up after item9?
That is natural sort doing its job. Digit runs are compared as numbers rather than character by character.
Can I sort and deduplicate in one pass?
Yes — tick “Remove duplicates”. The count removed is reported.
Does my text leave the browser?
No. Everything runs as JavaScript in this tab — there is no server involved and no request is made. Open the Network panel and watch, or turn your Wi-Fi off and keep using the tool.