Text
Sort lines of text
Drop in a column of names, prices, versions or IDs and put it in order. Numeric mode reads the number out of each line, so v1.9 lands before v1.10.
How to use it
- Paste the lines you want to sort.
- Choose a mode: A→Z, Z→A, numeric, by length, or reverse.
- Tick “Ignore case” to sort Apple and apple together.
- Tick “Remove duplicates” if repeated lines should collapse.
Alphabetical order depends on the language
Sorting by raw character code puts every capital before every lowercase letter, and every accented character after Z. Real alphabetical order is defined per language: Swedish places Å, Ä and Ö at the end of the alphabet, German phone-book order treats ö as oe, Spanish historically treated ch and ll as separate letters. A locale-aware comparison handles these; a naive one silently produces a list that looks sorted and is wrong.
Natural sort, for numbers embedded in text
Plain string comparison ranks “file10” before “file9”, because the character 1 sorts before 9. Natural sort compares the numeric runs as numbers, giving file9, file10, file11 — which is what a human expects. Anything with version numbers, chapter numbers or export filenames needs this, and it is why the numeric mode here pulls the number out of each line rather than comparing the text.
Sorting a config file without breaking it
Config files and changelogs are not flat lists: a section header has to stay attached to the lines under it. Sorting the whole file alphabetically detaches every header from its block. Sort one block at a time, or export the block, sort it, and paste it back.
Case sensitivity is the other trap. A case-sensitive sort puts every capitalised entry above every lowercase one, so Zebra lands before apple. Almost nobody wants that — case-insensitive is the correct default for anything a human will read, and case-sensitive only for identifiers where the compiler cares.
Frequently asked questions
How does numeric sort handle version strings?
It extracts the first number it finds on each line and compares those, so “v1.9” sorts before “v1.10” instead of after it as plain text sorting would.
What happens to non-numeric lines in numeric mode?
They are pushed to the end rather than treated as zero, which keeps headers and blank lines out of the way.
Is the sort stable?
Lines that compare equal keep their original relative order, so the result is predictable when you sort a second time.
Can I sort a CSV column?
Only if you isolate that column first — the tool sorts whole lines. Use the CSV to JSON converter if you need column-aware work.
Does sorting keep duplicate lines?
Yes. Sorting reorders, it does not de-duplicate; run them in sequence if you need both.
Why are numbers sorted as text?
Because string comparison goes character by character. Switch on numeric mode, which reads the number out of each line before comparing.