Clean Up Formatting Junk From Pasted Text
mso- styles, empty spans, non-breaking spaces, zero-width characters, and stray blank lines all ride along in a rich-text paste. Here is what the tool removes and what it keeps.
Direct answer
A rich-text paste carries markup that means nothing in Markdown: Office <o:p> tags and namespace elements, mso- style declarations, Mso classes, conditional comments, style and class attributes, empty spans and paragraphs, non-breaking spaces, zero-width characters, and soft hyphens. The tool removes all of them before conversion, then optionally collapses runs of blank lines. Words, headings, lists, links, and tables are untouched.
Open the Rich Text to Markdown converterWhen to use this
- Converted output is peppered with stray HTML tags or attribute leftovers.
- Text has gaps that no amount of editing seems to remove — usually non-breaking or zero-width spaces.
- Every second line in the output is blank.
Steps
- Paste the content into the box above; the cleanup runs automatically on every paste.
- Leave 'Clean up extra blank lines' on to collapse three or more newlines into a single blank line.
- Turn that toggle off and paste again when the blank lines are meaningful, such as in poetry or in preformatted text.
- Fix anything left over directly in the output box, which stays editable.
- Copy the Markdown, or download it as a .md file.
Example conversion
<p class="MsoNormal" style="mso-line-height:115%"><span style="font-size:11pt">Ship <b>Thursday</b>.</span><o:p></o:p></p>
Ship **Thursday**.
Common mistakes
- Do not use this to remove Markdown syntax from text. It produces Markdown; use the Markdown to Text tool for the opposite job.
- Do not expect it to fix bad source structure. If the original used bold instead of real headings, the output has bold instead of headings.
- Do not toggle the blank-line option and expect the current output to change. The toggle applies to the next paste.
- Do not paste plain text and expect cleanup of quote bars or ANSI codes; use the Clean Pasted Text tool for that class of junk.
FAQ
- What is mso- in pasted text?
- It is the prefix for Microsoft Office's proprietary CSS declarations, such as mso-line-height and mso-pagination. They only mean something inside Office and are removed here.
- What is a zero-width space?
- An invisible character (U+200B and its neighbours) that some editors insert for line-breaking control. It survives copy and paste and can break search, diffs, and code. The tool removes it along with joiners, byte-order marks, and soft hyphens.
- Does the cleanup change my words?
- No. Every rule targets markup, invisible characters, or blank lines. Visible text, headings, lists, links, and tables are preserved.
Related paste-to-Markdown guides
How to Paste a Word Document Into Markdown
Copy from Word, paste into the tool, get Markdown. The clipboard already carries an HTML version of the selection, so headings, lists, and tables survive the trip.
Convert a Google Doc to Markdown by Pasting It
Google Docs puts a b style=font-weight:normal wrapper around every copied selection. Left in place it bolds the entire document. This tool removes it before converting.
Convert an Email to Markdown Without the Formatting Junk
Outlook and Gmail messages are HTML with inline styles, mso- declarations, and non-breaking spaces. Paste the message body here to get readable Markdown instead.
Copy a Notion Page to Markdown Without Exporting
Notion's export produces a zip file. For one page, selecting the blocks and pasting them here is faster and gives you Markdown directly.