What is a text cleaner?
The text cleaner trims lines, collapses spaces, removes blank or duplicate lines, sorts A–Z, Z–A or naturally, and joins line breaks. Find and replace supports literal text or JavaScript regex through the regex tester’s timed worker. Counts show changes before you copy or download the result.
Features
- Case-sensitive duplicate line removal
- Spaces, trim, blank lines and breaks
- English alphabetical or natural sort
- Plain and timed-worker regex replacement
- Change counts, copy and text download
How to use the text cleaner
- Paste Input text and optionally enter Find and Replace with.
- Choose plain replacement or Use regular expression and flags.
- Set cleanup options and Sort lines.
- Press Clean text, review change counts, then copy or download.
Worked example
With trim, extra spaces, blank removal and duplicate removal enabled, apple
apple
item10
item2 becomes three lines. Natural sort gives apple, item2, item10. The count reports one duplicate and one blank line removed.
Operation order and limits
Replacement runs first, followed by spaces, trim, blank lines, duplicates, sort and line joining. Plain text fields allow 10 MB each. Regex uses the existing 500 ms worker timeout, 20,000 input characters, 1000 pattern characters, 2000 replacement characters and 1000 matches. CRLF/CR become LF. Counts use Unicode code points and include line breaks.
Frequently asked questions
Are duplicate lines case sensitive?
Yes. Apple and apple remain distinct. Trimming and space collapsing run before duplicate detection when enabled.
What does natural sort do?
It uses English collation with numeric comparison so item2 sorts before item10. A–Z and Z–A use ordinary English text collation.
Is replacement text literal?
Plain mode inserts it literally, including dollar signs. Regex mode follows JavaScript replacement tokens such as $1 and $&.
Can a complex regex freeze the page?
Regex work runs in a disposable worker terminated after 500 ms. Simplify the pattern or shorten input when the timeout appears.
Why does a setting change hide the result?
The previous result is cleared immediately so the copy/download cannot describe old settings. Press Clean text again to regenerate.
Last updated 16 November 2026. Made by Criza Labs. Spotted a mistake? Tell us.