Free · no sign-up · updated

No. 26 · PDF, image, text and code

Text cleaner

Tidy pasted lists, remove repeated lines and fix spacing.

Text and cleaning options

Up to 10 MB per field in plain mode. Inputs stay in this browser.

Order: find/replace → spaces → trim → blank lines → duplicates → sort → join line breaks. CRLF and CR line endings become LF. Character counts use Unicode code points, including line breaks.

Apply plain or regex replacements, sort the result and copy or download clean text.

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

  1. Paste Input text and optionally enter Find and Replace with.
  2. Choose plain replacement or Use regular expression and flags.
  3. Set cleanup options and Sort lines.
  4. Press Clean text, review change counts, then copy or download.
Full guide · 5 min read · examples and common mistakes How to Clean Text, Sort Lines and Replace Matches

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.

PDF & image

Word Counter

Count words, characters with and without spaces, sentences and paragraphs as you type, with reading and speaking time.

PDF & image

Case Converter

Convert text to UPPERCASE, lowercase, Sentence case, Title Case, camelCase, snake_case, kebab-case and more in one click, then copy.

PDF & image

Regex Tester

Test JavaScript regular expressions with flags, live match highlighting, capture groups and replacement preview.

Made by Criza Labs

Need a custom tool for your team or customers?

Criza Labs builds tools like this into websites, billing systems and internal apps: with your branding, your data and your workflow. Fixed scope, fixed price, and you own the code.