1. What does this tool do
This free online Text Cleaner finds and replaces or removes text. Use plain text (e.g. replace "foo" with "bar") or patterns (regex) for power users. Remove matches or replace them, one or many rules in a row. Use it for find and replace, text cleanup, or bulk replace. No sign-up, no upload; everything runs in your browser. Chain rules so the output of one becomes the input of the next. Invalid regex is caught with an inline error. Ideal for data cleanup, stripping characters, normalising spacing, stripping markup, or CSV cleanup.
2. How to use it
Quick start: Paste your text. Enter what to find (plain text or a pattern like \s+ for spaces). Leave replacement empty to remove, or type replacement text. Use "Match as plain text" for simple find-and-replace without regex. Turn on Keep match length when you want each match replaced by the same number of characters (for example, digits → # so 100 becomes ###). Add more rules to chain. Invalid pattern shows an error under that rule.
- Enter text — Paste or type the text to process.
- Find — Enter plain text or a pattern (e.g.
\d+for digits,\s+for whitespace). Use "Match as plain text" for literal matching. Use "Add pattern" to chain multiple rules. - Replace (optional) — Leave empty to remove matches, or enter replacement text for each rule. Turn on Keep match length when you want each match replaced by a string whose length equals the original match.
- Set flags — Toggle global (g), case-insensitive (i), etc. Shared across all rules.
- Apply — Click to run (or use Live mode). The result appears; invalid pattern shows an error under the rule that failed.
3. How it works
Each pattern is validated with new RegExp() before use. You can choose how rules are applied:
- Chain (default) — Rules run one after the other: the output of rule N becomes the input to rule N+1. Use this for steps like "remove URLs → collapse spaces → trim lines".
- Override — Each rule is applied to the original text. When matches overlap, the last rule (by order in the list) wins. Use this when you want several rules to target different parts of the same text without one rule changing what the next sees.
- First match — Each rule is applied to the original text. When matches overlap, the first rule wins. Use this for priority order (e.g. replace A first, then B only where A didn't match).
If any pattern is invalid, processing stops and shows partial output with the error under the failing rule. The global (g) flag is the default so all occurrences are replaced in one pass per rule. All processing runs client-side in your browser. No data is sent to any server.
4. Use cases & examples
- Clean data — Remove extra spaces, newlines, or special characters.
- Extract — Use capture groups to extract and replace (e.g. reformat dates).
- Normalise — Replace variants (e.g. multiple spaces → single space).
- Strip markup — Remove HTML tags or other markup.
- CSV cleanup — Fix delimiters or escape sequences.
Example
- Pattern
\s+, replace→ Collapses multiple spaces to one. - Pattern
\d{3}-\d{3}-\d{4}, replace[REDACTED]→ Hides phone numbers. - Pattern
[^\w\s], replace empty → Removes all punctuation.
5. Limitations & known constraints
- Pattern validated first — Invalid regex shows an error; no replacement is attempted.
- ReDoS — Extremely complex patterns may cause slow execution; avoid catastrophic backtracking.
- Rule application mode — Chain (default): each rule processes the output of the previous. Override / First match: all rules apply to the original text; overlap resolved by last or first rule.
- JavaScript regex — Uses JS regex flavour; some PCRE features may differ.