complete.tools

Remove Text Formatting

Turn styled or marked-up text into plain text: HTML tags, fancy Unicode letters, curly quotes, hidden characters and extra spaces.

What this tool does

Turn styled or marked-up text into plain text: HTML tags, fancy Unicode letters, curly quotes, hidden characters and extra spaces. You fill in these fields: Text to clean. Tick boxes adjust the calculation. It shows plain text, characters before, and characters after.

Inputs

  • Text to clean: Longer text, up to 100000 characters.
  • Remove HTML tags: A tick box, ticked to start. Deletes tags, comments, script and style blocks, and decodes entities such as &. Paragraph and line-break tags become line breaks.
  • Turn fancy letters into plain ones: A tick box, ticked to start. Bold, italic, script and fullwidth Unicode letters, circled numbers and ligatures become ordinary characters. Non-breaking and wide spaces become normal spaces. Accents are kept.
  • Straighten quotes and dashes: A tick box, ticked to start. Curly quotes become straight quotes. En and em dashes become a hyphen.
  • Remove hidden characters: A tick box, ticked to start. Deletes zero-width spaces, word joiners, byte order marks, soft hyphens and left-to-right and right-to-left marks.
  • Tidy spaces and blank lines: A tick box, ticked to start. Turns runs of spaces and tabs into one space, trims each line, and shrinks runs of blank lines to one. Line breaks are kept.

How to use

  1. Type the text to clean.
  2. Tick "Remove HTML tags" if it applies.
  3. Tick "Turn fancy letters into plain ones" if it applies.
  4. Tick "Straighten quotes and dashes" if it applies.
  5. Tick "Remove hidden characters" if it applies.
  6. Tick "Tidy spaces and blank lines" if it applies.
  7. Read the result: plain text, characters before, and characters after. It appears once every required field has a valid value.
  8. Use the copy button to copy the text.

Worked examples

Example 1. Inputs:

  • Text to clean: "𝐇𝐞𝐥𝐥𝐨 world ①"
  • Turn fancy letters into plain ones: Yes

Results:

  • Characters before: 13
  • Characters after: 13

How this is worked out: Unicode NFKC compatibility mappings (UAX #15): mathematical bold H e l l o (U+1D407 and so on) map to H e l l o, fullwidth w o r l d (U+FF57 and so on) map to w o r l d, and circled digit one (U+2460) maps to 1. Input is 5 + space + 5 + space + 1 = 13 characters and so is the output.

Example 2. Inputs:

  • Text to clean: "<p>Tom &amp; Jerry&nbsp;say &quot;hi&quot;</p> <br>Next <b>line</b>"
  • Remove HTML tags: Yes

Results:

  • Characters before: 67
  • Characters after: 32

How this is worked out: The p tag is dropped, the closing p tag becomes a line break, the line break already in the text stays, and the br tag becomes a line break, giving three in a row. The b tags are dropped. Entities decode to & (amp), a space (nbsp) and quotation marks (quot). Count before: p 3, Tom 3, space 1, &amp; 5, space 1, Jerry 5, &nbsp; 6, say 3, space 1, &quot;hi&quot; 6 + 2 + 6 = 14, closing p 4, line break 1, br 4, Next 4, space 1, b 3, line 4, closing b 4 = 67. Count after: Tom & Jerry say = 15 + space, then "hi" = 4, three line breaks, Next line = 9, total 32.

Example 3. Inputs:

  • Text to clean: "“Smart” quotes ‘here’ – done. Next line"
  • Straighten quotes and dashes: Yes
  • Tidy spaces and blank lines: Yes

Results:

  • Characters before: 54
  • Characters after: 40

How this is worked out: Curly double quotes become straight, curly single quotes become straight, the en dash becomes a hyphen. Runs of spaces become one, each line is trimmed, the four line breaks (three empty lines) shrink to one blank line, and the ends are trimmed. Count before: “Smart” 7, 3 spaces, quotes 6, space, ‘here’ 6, space, dash, space, done. 5, 3 spaces = 34 on the first line, then 4 line breaks = 38, 3 spaces, Next 4, 3 spaces, line 4, 2 spaces = 54. Count after: "Smart" quotes 'here' - done. = 29, 2 line breaks, Next line = 9, total 40.

Example 4. Inputs:

  • Text to clean: "Plain text stays plain."
  • Remove HTML tags: Yes
  • Turn fancy letters into plain ones: Yes
  • Straighten quotes and dashes: Yes
  • Remove hidden characters: Yes
  • Tidy spaces and blank lines: Yes

Results:

  • Characters before: 23
  • Characters after: 23
  • Note: Nothing needed changing with the steps you ticked.

How this is worked out: Text with nothing to clean is returned as it is. Plain 5, space, text 4, space, stays 5, space, plain. 6 = 23 characters.

Limitations

  • HTML handling is a simple pattern match, not a full HTML parser. Use it to clean snippets, not to extract text from complex pages.
  • A less-than sign directly followed by a letter is read as the start of a tag. In text that is not HTML, such as a<b and c>d, everything between the two signs is removed. Untick Remove HTML tags for that kind of text.
  • Only a short list of named entities is decoded (amp, lt, gt, quot, apos, nbsp), plus numeric ones. Other named entities stay as typed, and a non-breaking space entity becomes a normal space.
  • Compatibility normalisation also changes some symbols and fractions, not only letters.
  • Fancy letters with no plain equivalent in Unicode are not changed: small capitals, upside-down letters, white-on-black circled or squared letters, and lookalike letters borrowed from other alphabets.
  • Hidden characters outside the listed ones are kept, including zero-width joiners, which some scripts and emoji need.
  • Text longer than 100,000 characters is not accepted.

FAQs

Q: Will this strip bold and italic from text I copied from a document?
A: Text boxes hold plain text, so bold, italic and font changes made by an editor are already gone once you paste. This tool cleans what survives pasting: HTML source, fancy Unicode letters, curly quotes, hidden characters and extra spaces.
Q: Does it remove accents?
A: No. Accented letters are kept as they are.
Q: What does Turn fancy letters into plain ones change besides letters?
A: It applies Unicode compatibility normalisation, so it also changes things like superscript two to 2, the trademark sign to TM, and a one-half sign to 1, a fraction slash and 2. Untick it if you want those kept.
Q: Does it remove Markdown?
A: No. Characters such as asterisks and hash signs are ordinary text and are kept.

Explore Similar Tools

Explore more tools like this one: