What this tool removes
Text gets formatting from wherever it was written. A web page wraps words in HTML tags. A README or chat message uses Markdown asterisks and hashes. Forums use BBCode in square brackets. Copying from Word, Google Docs or an email can bring no-break spaces, zero width characters and extra blank lines.
A note on what happens when you paste. The input box on this page is a plain text box, like any textarea. When you paste rich text from Word or a web page, your browser already drops bold, italics, fonts, sizes, colors and link styling before the text arrives. What it cannot drop is formatting that is written as characters: tags you copied as code, Markdown symbols, BBCode, entity codes such as &, and hidden spacing characters. That is the part this tool cleans.
How to use it
- Paste into Formatted text. A sample with HTML and Markdown is loaded so you can see it work.
- The Plain text box shows the cleaned result as you type.
- Choose what to remove. These are on by default:
- Remove HTML tags
- Remove Markdown
- Remove BBCode
- Fancy fonts to normal letters
- Tidy spaces and blank lines
- Switch on Straighten curly quotes and dashes if you also want keyboard quotes and hyphens.
- Press Copy or Download. The note says how many characters of formatting were removed.
Examples
All results below were produced by this tool with its default settings. A ¶ marks a line break.
| Formatted text | Plain text |
|---|---|
<p>We hit our goal & shipped the <a href="https://example.com">new site</a>.</p> |
We hit our goal & shipped the new site. |
## Next steps ¶ ¶ - **Fix** the _footer_ ¶ - Read the [style guide](https://example.com/guide) |
Next steps ¶ ¶ Fix the footer ¶ Read the style guide |
[b]Sale[/b] ends [url=https://example.com]Friday[/url] |
Sale ends Friday |
Use **bold** and *italic* and plus a word in backticks |
Use bold and italic and code. |
Tom & Jerry <3 |
Tom & Jerry <3 |
> Quoted line ¶ # Heading |
Quoted line ¶ Heading |
| snake_case_name and 2 * 3 * 4 stay as they are | snake_case_name and 2 * 3 * 4 stay as they are |
How it works
The tool runs a series of clean-up passes in a fixed order.
- Markdown goes first. Code fences, horizontal rules, table separator rows and link definitions are removed. Headings, quotes and bullets lose their marks. Images keep their alt text and links keep their label. Bold, italic, strike-through and inline code lose their symbols, but only when the symbols wrap text from the outside.
- HTML comes next. Comments, scripts and styles are removed whole. Block elements turn into line breaks so paragraphs stay apart, table cells turn into tabs, and every other tag is removed. Named and numbered character codes are decoded.
- BBCode tags in square brackets, such as [b], [url=…] and [quote], are removed while their text stays.
- Fancy fonts from font generators are mapped back to normal letters, and strike-through marks are removed.
- Tidying removes invisible characters, turns odd spaces into normal ones, removes spaces at the start and end of lines, and limits blank lines to one in a row.
Tips and limits
- Lists lose their bullets. That is the point of removing formatting, but if you want to keep a list shape, add your own hyphens afterwards or use the line break remover to turn the list into a comma separated line.
- A less-than sign followed by a letter, with a greater-than sign later on, looks like an HTML tag and is removed. If you are cleaning maths or code, switch off Remove HTML tags.
- Indentation is removed when tidying is on. Switch off Tidy spaces and blank lines to keep it.
- Links keep their words, not their addresses. If you need the URLs, copy them before cleaning.
- Styled Unicode letters are converted here too. For more control over quotes, emoji, accents and hidden characters, use the plain text converter.
Other ways to do it
Word: select the text and press Ctrl+Space to clear character formatting, or use Paste Special and choose Unformatted Text when pasting. Neither removes tags or Markdown typed as characters.
Google Docs: press Ctrl+Shift+V to paste without formatting, or use Format, then Clear formatting (Ctrl+\). Again, symbols typed as text stay.
Mac: Cmd+Shift+Option+V pastes and matches the style of the surrounding text in many apps.
Code: in a browser, new DOMParser().parseFromString(html, 'text/html').body.textContent gives the text of an HTML string. In Python, BeautifulSoup’s get_text() does the same. Markdown usually needs a parser or a set of regular expressions like the ones this tool uses.
If the cleaned text still has double spaces or stray blank lines from the source, the whitespace remover gives you finer control over them.