Line Tools

[ LINES ]
Cherry apple banana date
7 lines in, 4 out
Lines in7
Lines out4
Duplicates removed2
What to do
[ WHAT THIS IS ]

The most surprising result this tool can produce: two lines that look identical and are not. apple and apple  are different strings, so a dedupe keeps both unless they were trimmed first. That is why trim runs first in the order, and the page says so when it happens.

The operations run in a fixed order, whatever order you select them. A result that depended on which checkbox you clicked first would be impossible to reason about.

Sorting compares code units, never localeCompare. A locale-dependent sort gives a different result on two machines — and a sorted file that still shows a diff defeats the point. Natural sort is its own mode: item9 before item10 is right for a person and wrong for an identifier.

[ QUESTIONS ]

Why did removing duplicates leave two lines that look identical?

Because they are not identical — one of them has a space on the end. Two lines differing only by whitespace look exactly the same on screen and are different strings, so a dedupe that has not trimmed first keeps both. Switch on Trim whitespace. This page says so when it finds that case.

Does the order I tick the boxes in matter?

No. The operations run in a fixed order whatever order you select them: trim, remove blanks, remove duplicates, sort, reverse, shuffle, number. That is deliberate — a result that depended on which box you clicked first would be impossible to reason about.

Why is item10 sorted before item9?

Because a plain sort compares characters, and the character “1” comes before “9”. That is correct for identifiers and filenames, and wrong for anything a person reads as a list. Use Sort naturally, which compares runs of digits as numbers, and gives item9 before item10.

Why not use a locale-aware sort?

Because a locale-dependent sort gives a different result on two machines, and a sorted file that still shows a diff against someone else’s defeats the point of sorting it. This compares code units, which is the same rule the JSON formatter follows for sorting keys.

What happens to my Windows line endings?

They are preserved. If the text arrives with CRLF endings it leaves with them. Silently rewriting every line ending changes every line of the file, which shows up in version control as a diff touching everything — one of the more annoying ways a text tool can waste your afternoon.

Is my text sent anywhere?

No. Everything happens in your browser, and nothing is transmitted or stored.

[ THE MATHS ]
The fixed order
1. Trimbefore dedupe, or look-alikes survive
2. Remove blanksfewer lines for the rest
3. Remove duplicatesthe first one seen is kept
4. Sortplain or natural
5. Reverse, shuffle, numberthe shuffle runs last
[ ITEM9 BEFORE ITEM10 ]
Plain sortitem1, item10, item9
Natural sortitem1, item9, item10

Both are correct. Plain compares characters and is right for filenames; natural reads a run of digits as a number.

[ NEXT ]
51Word & Character CounterHow much is actually there
54Text ExtractorPull values out rather than reordering them
48Text ComparisonWhen two lists should match and do not
49Text Case ConverterChange the case, not the order
[ IMPORTANT ]

Runs entirely in your browser; nothing is transmitted. Operations apply in a fixed order regardless of the order you select them, and Windows line endings are preserved. Nothing you type here is sent to our servers — the calculation runs entirely in your browser.