Tools › Text
Text Cleaner
Build a recipe of clean-up steps and run them in order: trim and collapse spaces, remove blank, duplicate or matching lines, unwrap PDF text, sort, change case, find and replace, and strip HTML, Markdown or AsciiDoc; wrap, pad or number lines; and pull out email addresses, URLs, IP addresses or hashes. Save recipes, export them or share them as a link.
About this tool What it's for, how to use it and an example
What it's for
Clean up messy text with a recipe: a list of steps that run one after another, each taking the result of the one before. Build a recipe once and you can reuse it on any text, save it, or send it to someone as a link.
- When you’re tidying a list copied from a web page, PDF or spreadsheet, full of stray spaces, blank lines, duplicates and hidden characters.
- When you’ve copied text from a PDF or an email and every line is broken at the same width, or quoted with
>. - When you need the plain words from Markdown, AsciiDoc or HTML, without the markup.
How to use it
Paste your text. The result updates as you type and whenever you change a step. Choose a built-in recipe, or add steps with Add a step. Each step has its own options. Untick a step to skip it without removing it. Drag the ⠿ handle to change the order, or focus it and press the up and down arrow keys. Each step shows how many lines it leaves, or No change. A step that fails, such as one with a broken regular expression, shows why and passes the text on unchanged.
Besides tidying, steps can number lines or remove numbers, wrap long lines at a width, pad lines to a width, and Keep only… email addresses, URLs, IP addresses, hashes, numbers, domain names, or hashtags and mentions, one per line, for pulling indicators or contacts out of a log or an email.
Save as… keeps the recipe in this browser, under Yours. Export downloads it as a .recipe.json file
and Import… adds one, or a list of them, to yours. Copy link copies a link that opens the recipe; it holds
only the steps, not your text. In separator, prefix, suffix and replacement boxes, type \t for a tab. Your
current steps are remembered.
Example
Choose the Tidy a list recipe and paste this:
banana
apple
Banana
item 10
item 2
The result is apple, banana, item 2, item 10, and the tool reports 6 lines in, 4 out. The duplicate
Banana and the blank line are gone. Drag Sort lines above Remove duplicate lines and the result is the
same, but the sort step now shows 5 lines.
Good to know
Strip Markdown and Strip AsciiDoc work line by line with patterns, not a full parser, so lines stay where they were and table rows become tab-separated cells, but unusual markup can survive. For an exact conversion, use the Markup Converter. Removing duplicates keeps the first of each. Remove invisible characters also removes direction marks, which right-to-left text can rely on. A recipe from a file or link keeps only the steps this tool knows.
No steps yet. Add one below, or choose a recipe.
Private: this tool runs in your browser. Nothing you type, paste or choose leaves this page.
Saved you a few minutes? Say thanks with a coffee.
Something wrong with this tool, or missing from it? Report a bug or suggest a feature.