Text Cleaner
TextEverything runs locally in your browser — nothing is uploaded
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
- Paste the text you want to clean
- Tick the rules you need; the result updates as you type
- 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
Word Counter
TextCount Chinese characters and English words separately, alongside characters, lines, real UTF-8 bytes and reading time. Runs in your browser.
Text Diff
TextCompare two blocks of text online and highlight added, removed and unchanged lines, so only the lines that changed are marked. Runs in your browser.
Case Converter
TextConvert identifiers between eight naming styles. Words are split correctly first, so acronyms such as HTTPServer come out right, all in your browser.
Chinese Converter
TextConvert Chinese between simplified and traditional characters, leaning on common words first and the most usual form for the rest, all in your browser.
Regex Tester
TextTest a regular expression with live highlighting, capture groups and a replace preview, guarded against catastrophic backtracking. Runs in your browser.
Markdown Preview
TextWrite Markdown on the left and see it rendered on the right, with pasted HTML shown as text and images never fetched. Runs entirely in your browser.