piapia123
en

Text Cleaner

Text

Everything runs locally in your browser — nothing is uploaded

Input
Output

Anything copied out of a log, a spreadsheet or a chat tends to arrive with duplicate lines, blank lines, leading numbers and stray spaces. This tool splits the cleanup into six rules you can switch on one at a time. The order is fixed — strip line numbers, collapse spaces, trim, drop blank lines, deduplicate, then sort — because order changes the result: sorting before deduplicating keeps a different line than deduplicating first.

Features

  • Deduplicate lines, keeping the first occurrence and preserving the order of the rest
  • Sort lines by code point, so the result never depends on your browser locale
  • Remove blank lines, including lines holding only spaces or tabs when trimming is enabled too
  • Trim leading and trailing spaces on every line
  • Strip line numbers written as 1. / 1) / (1) / 1: without mistaking dates or times for numbering
  • Collapse runs of spaces, tabs and full-width spaces into a single space
  • Every rule is independent — with none ticked the text passes through unchanged apart from LF endings

How to use

  1. Paste the text you want to clean
  2. Tick the rules you need; the result updates as you type
  3. Click Copy to take the result

FAQ

How does deduplication decide what to keep?
It is case sensitive and keeps the first occurrence of each line, leaving the relative order of the rest untouched. To treat differing cases as the same line, normalise the case first.
I removed blank lines but some are still there. Why?
A line containing only spaces or tabs is not an empty string. Turn on trimming as well and those lines become truly empty, after which they are removed. The two rules are meant to be used together.
Will stripping line numbers eat real numbers in my text?
No. The rule requires a clear separator after the digits (a dot, comma, colon, bracket and so on) and whitespace after that, so dates such as 2026.09 and times such as 3:00 are left alone.
Is the sort order stable?
Yes. Sorting compares code points rather than locale-aware collation, so the same input always produces the same output. Note that uppercase letters sort before lowercase ones.

Related tools