Sort Lines

Sort by

About Sort Lines

Rearranges every line by a rule. Three modes: A→Z, Z→A, and by length (shortest first).

"Numeric order" is on by default, which puts item2 before item10. A plain string comparison walks character by character, and 2 sorts after 1, so item10 would otherwise land before item2 — a difference that really matters when you are sorting filenames, version numbers or chapter headings.

"Remove duplicates" cleans up identical lines in the same pass. "Trim spaces" and "Ignore case" only affect how lines are compared — your output keeps the original spelling and spacing.

Chinese sorts by pinyin, and Japanese, Russian and others follow their own collation rules, because this uses the browser's built-in collation rather than comparing raw Unicode code points.

Frequently asked questions

Does it sort Chinese correctly?

Yes — by pinyin order, not by Unicode code point.

What does numeric order do?

It puts item2 before item10. Without it, characters are compared one by one, so 10 sorts ahead of 2.

Will sorting remove duplicate lines?

Not by default. Turn on "Remove duplicates" for that.

Where do blank lines end up?

"Drop blank lines" is on by default. If you turn it off, blank lines sort as empty strings and usually land at the top.

Related tools

Text View all ›