lines · order · whitespace

Text tools: sort, dedupe, trim, count

The small operations on a list of lines — order it, de-duplicate it, clean the whitespace, and see exactly what changed.

0 characters

The text is transformed in this tab. Logs and config often hold internal names, so nothing is uploaded.

Short answer: paste the lines, tick what you want done, read the result. The summary says how many lines came in, how many went out and how many duplicates were dropped — so a shorter list is never a surprise.

Order of operations matters

The page trims, then de-duplicates, then sorts. De-duplicating after sorting would keep the last copy instead of the first, and trimming after de-duplicating would treat"a" and "a " as different keys. Both orders are defensible; this one keeps the line that first appeared, which is what people mean by "remove the repeats".

Counts worth trusting

Characters are Unicode code points, words are runs of non-whitespace, lines are newline separated, and bytes are the UTF-8 encoding. Those four numbers disagree on purpose — a pasted list of names with accents can be 900 characters and 1,100 bytes.

Comparing two versions of the same file? The text diff shows which lines changed, and the case converter renames identifiers without touching the rest.

Text tool questions

What does “natural” sorting do?

It compares numbers by value, so file2 comes before file10 instead of after it. Plain string sorting puts file10 first because "1" sorts before "2", which is the bug people come here to fix. The comparison uses Intl.Collator with numeric collation, so accented letters keep their order too.

How is a duplicate detected when case is ignored?

The first occurrence is kept and every later line that folds to the same lower-case string is dropped. Turn the option off and Apple and apple count as different lines. The summary always states how many lines were removed, so a silent shrink cannot happen.

Why count bytes separately from characters?

A character is what you see; a byte is what a file, a database column or a request limit measures. ₹ is one character and three bytes in UTF-8, and emoji are four. Pasted text that fits a 1,000-character field can still overflow a 1,000-byte column.

Does wrapping change the text?

Yes — it inserts real line breaks, which is what you want for a plain-text email or a fixed-width log. If you only need soft wrapping for reading, leave the width at 0 and let the editor wrap visually.

Is the text uploaded?

No. Every operation is a string transform in this tab, including the counts. Logs and configuration files usually contain internal hostnames and tokens, which is exactly why this runs locally.

Related tools