Bulk Text Cleaner and Formatter
Paste text, tick the cleaning steps you want, press Clean and get tidy text with line and character counts.
- Lines in
- 0
- Lines out
- 0
- Characters in
- 0
- Characters out
- 0
Clean messy text in one pass
Text copied from web pages, word processors and content systems often arrives with leftover HTML tags, curly quotes, long dashes, stray spaces, empty lines and repeated lines. This tool cleans all of that in bulk, so writers, editors and web content staff can paste a block of text and get plain, consistent text back.
You choose which cleaning steps to apply. Five steps are ticked by default: strip HTML tags, replace typographic characters, trim each line, collapse spaces and remove blank lines. Removing duplicate lines is off until you tick it, and the case menu can turn everything into lowercase or UPPERCASE.
Everything runs in your browser. After each run you see how many lines and characters went in and how many came out, and the Copy button puts the cleaned text on your clipboard.
How to use the text cleaner
- Paste or type your text into the input box. There is no length limit.
- Tick the cleaning steps you want and pick a letter case.
- Press Clean. The cleaned text appears in the read-only box together with the line and character counts.
- Press Copy to put the cleaned text on your clipboard.
The seven cleaning steps, in order
First, every Windows line break (CR LF) and every lone CR becomes a plain line break (LF). Then the steps below run in this fixed order. An unticked step is skipped. Lines are split on line breaks and joined with line breaks.
- Strip HTML tags. HTML comments are removed first, from
<!--to the next-->. Then each run that starts with<followed directly by a letter, a slash or an exclamation mark, and ends at the next>, is removed. A<followed by a space, a digit or any other character is kept as text. Finally these entities are decoded in one pass, each once:&,<,>,",'and (which becomes a space). Because decoding comes after tag removal, text that was<b>stays as the visible text<b>. - Replace typographic characters. Curly single quotes become a straight apostrophe, curly double quotes become a straight double quote, en and em dashes become a hyphen, the ellipsis character becomes three full stops and a non-breaking space becomes a normal space.
- Trim each line. Spaces and tabs are removed from the start and end of every line.
- Collapse spaces. Inside a line, every run of two or more spaces or tabs becomes one space.
- Letter case. The text is changed to lowercase or UPPERCASE if you chose one in the case menu.
- Remove blank lines. Lines that are empty or hold only spaces and tabs are removed.
- Remove duplicate lines. The first occurrence of each line is kept. Lines are compared exactly and case-sensitively, after all the earlier steps.
Please note: this tool does not understand HTML structure. It removes tag-like text exactly as described above, so check the result before you use it.
Frequently asked questions
Is my text sent anywhere?
No. The cleaning runs entirely in your browser on this page, so the text you paste is not uploaded.
Will a less-than sign in ordinary text be removed?
No. Only a < that is followed directly by a letter, a slash or an exclamation mark starts a tag. A < followed by a space, a digit or any other character stays as text, so a<5 and b>3 is kept unchanged.
How are lines and characters counted?
Lines are 0 for empty text and otherwise the number of line breaks plus 1. Characters are counted as Unicode code points after line breaks are normalised, so an emoji counts as 1 character and each line break counts as 1.
Why were two lines that differ only in letter case both kept?
Duplicate removal keeps the first occurrence of each line and compares lines exactly, including case, after the earlier steps. Choose lowercase or UPPERCASE in the case menu if lines that differ only in case should be treated as duplicates.