filetity
Order
Your lines
Result
LocalThis runs in your browser. Nothing you paste is sent anywhere.

LINES -> SORTED · Local tool

Sort Lines

Sort lines alphabetically, naturally, by length or at random.

Last updated

How do I sort a list of lines alphabetically?

Paste the lines into filetity and pick an order: A to Z, Z to A, natural, by length, or shuffled. Everything runs in the browser tab with nothing uploaded. Natural order is the one worth knowing about, because it compares runs of digits as numbers, so file9 comes before file10 rather than after it, which is why a plainly alphabetical list of filenames or versions looks shuffled. Sorting by length breaks ties alphabetically, so the same input gives the same output on every machine rather than whatever order the engine happened to leave. The shuffle is Fisher-Yates, where every ordering is equally likely, rather than the common one-liner of sorting with a random comparator, which is measurably biased.

  1. 01 / Your device

    the file stays here

  2. 02 / Browser memory

    the work runs locally

  3. 03 / Back to you

    saved on this device

When you would use this

Situations, not settings.

A list of names, emails or tags
Alphabetical with blank lines dropped and each line trimmed, because a leading space sorts before every letter and ruins the result.
Filenames or version numbers
Natural order puts file9 before file10, which plain alphabetical order does not, and that is why a sorted list of filenames usually looks shuffled.
Picking a random order
Fisher-Yates, so every ordering is equally likely, rather than the biased one-liner of sorting with a random comparator.

How it works / no cloud

A conversion engine, not an upload form.

Natural order compares runs of digits as numbers, so file9 comes before file10 rather than after it, which is why a plainly sorted list of filenames looks shuffled. Shuffling uses Fisher-Yates, not a random comparator, which is measurably biased and is not a shuffle at all.

  • Offline ready
  • Installable app
  • No file limit queue

Straight answers

No accordion. Nothing hidden.

Is it free?
Yes, with no watermark and no page limit.
Does it need an account?
No. There is no account system.
Is my file processed on my device?
Yes. The file is read by your browser and never uploaded. There is no server to send it to.
What formats are supported?
Any lines in. Sorted A to Z, Z to A, in natural order, by length, or shuffled.
What are the limits?
Sorting is by the text of each line. There is no column awareness, so a table of tab separated values sorts by whatever its first column happens to be.
Does it work on mobile?
Yes, on any modern mobile browser. Large files are limited by the memory the phone gives the browser.
Does it work offline?
Yes, once the page has loaded. The tool keeps working with no network connection.
Why is file10 before file9 when I sort alphabetically?
Because alphabetical order compares character by character, and the character 1 comes before 9. That is correct and it is almost never what anybody wants for filenames or versions, which is what the natural order option is for: it compares runs of digits as numbers.
Where do capital letters end up?
Interleaved with lowercase by default, using your locale's own collation, so Apple and apple sit next to each other rather than in two separate blocks. Turn on ignore case if you want them treated as identical for ordering purposes.
Is the shuffle actually random?
Yes, Fisher-Yates, where every ordering is equally likely. The common one-line version, sorting with a comparator that returns a random number, is noticeably biased because a sort assumes its comparator is consistent and that one is not.
What happens to blank lines and indentation?
Blank lines are dropped and each line is trimmed by default, because a leading space sorts before every letter and turns a sorted list into a mess. Both are toggles, so you can keep them when the whitespace is meaningful.
Does sorting by length break ties predictably?
Yes, alphabetically. Without a tie break, two lines of the same length come back in whatever order the engine happened to leave them, which changes between browsers and makes the same input give different output on different machines.

Keep working locally

3 available · more coming