Skip to main content
FileForge

Sort Text Lines

Browser processing — files never leave your device

Put any list in order: alphabetical (A–Z or Z–A), natural numeric order, or by line length — with one click.

Loading tool…

How to use this tool

  1. Paste your lines into the input box.
  2. Pick a sort: A–Z, Z–A, natural/numeric, or by length.
  3. Toggle case-insensitive if capitalization shouldn't matter.
  4. Click Sort lines and copy the result.

About this tool

Plain alphabetical sorting puts "item10" before "item2" because it compares character by character. The natural sort option here compares embedded numbers by value, producing the order humans expect. You can also sort case-insensitively, reverse any order, or sort by line length, which is useful for reviewing data exports and organizing word lists.

Frequently asked questions

Why does normal sorting put item10 before item2?
Character-by-character comparison sees "1" before "2" and stops there. Choose the natural sort option to compare the numbers by value: item2, then item10.
How are empty lines handled?
Empty lines sort to the top in ascending order. If you don't want them, remove blank lines first with the Remove Extra Spaces tool.
Does sorting handle accented characters sensibly?
Yes — locale-aware comparison places accented letters next to their base letters (é near e) instead of at the end of the alphabet.