Markdown Remove HTML
Markdown Remove HTML strips HTML tags from Markdown while keeping the text between them and all Markdown syntax. Lines inside fenced code blocks are left untouched. Your text is cleaned line by line on the server, up to 200,000 characters, and returned for copying or download. Tags are removed, not converted, so links and images written in HTML lose their URLs.
Use Markdown Remove HTML
Markdown Remove HTML
Remove raw HTML tags and blocks while keeping your Markdown content clean and readable.
Read Content
Strip HTML tags from Markdown, keep the words
Markdown Remove HTML takes Markdown that has HTML tags mixed into it and removes the tags, leaving the text between them and all of your Markdown syntax in place. A line like Our <strong>new</strong> plan is <span style="color:red">live</span> comes out as Our new plan is live. Headings, lists, links, emphasis written with asterisks, tables and fenced code blocks are not touched.
HTML ends up in Markdown for many reasons: CMS exports, content copied from a web page, newsletters built in an email designer, rich text editors that save inline formatting, or older documentation that used <br> and <div align="center"> for layout. Some platforms then refuse that HTML, show it as raw text, or render it inconsistently. Removing it gives you portable, plain Markdown.
How the tool decides what to remove
When you click Remove HTML, your Markdown is sent to the site's Markdown API. The server normalises line endings and goes through the document one line at a time:
- Lines inside fenced code blocks (opened by
```or~~~) are kept exactly, so HTML examples in your code samples survive. - On every other line, anything that starts with
<and runs to the next>on the same line is deleted. - Blank space at the start and end of the whole document is trimmed.
The result is returned to your browser and shown in the output editor. The endpoint returns the text and does not save it. Requests are limited to 200,000 characters.
Tags go, content stays
It is important to understand that the tool removes tags, not elements. The text inside an element remains:
| Input line | Output line |
|---|---|
<p align="center">Welcome</p> | Welcome |
Line one<br>Line two | Line oneLine two |
<img src="logo.png" alt="Logo"> | empty line |
<!-- draft note --> | empty line |
<kbd>Ctrl</kbd> + <kbd>C</kbd> | Ctrl + C |
<script>track()</script> | track() |
The last row is the one to watch: the contents of script and style elements are left behind as plain text, because only the tags are stripped. Delete those leftovers by hand. Similarly, an HTML image disappears entirely, alt text included, since the alt text lives inside the tag.
Using the tool
- Paste your Markdown into Input Markdown, or click Paste at the top. The footer shows the character count and a count of possible HTML tags, a quick indication of how much there is to clean.
- Click Remove HTML. The button changes to "Working" until the server responds.
- Review the Output Markdown editor. Its footer shows characters and words.
- Use the copy icon on the output card, or the download icon to save
markdown-without-html.md. - The trash icon on the input card clears both editors.
Before you run it: things HTML was doing for you
Because the tool removes tags without converting them, any meaning carried by those tags is lost. Consider replacing these in Markdown first, or after cleaning:
- Line breaks.
<br>between two words leaves them stuck together. Put a real line break, or end the line with a backslash. - Images. Rewrite important
<img>tags asso they are kept. - Links. An
<a href="...">text</a>becomes justtext; the URL disappears. Convert key links to[text](url)beforehand. - Collapsible sections.
<details>and<summary>wrappers are removed and their contents become normal paragraphs.
Watch out for angle brackets that are not HTML
The removal rule looks for any <...> pair on a line. That catches more than HTML:
- Autolinks. Markdown's
<https://example.com>autolink form and email autolinks are removed completely. - Inline code on normal lines. An example like
`<div>`outside a fenced block loses its tag and leaves empty backticks. - Comparisons and placeholders. Text such as
a < b and c > dorgit checkout <branch>outside code fences can lose the part between the brackets.
If your document has these, put command examples in fenced blocks before cleaning, and convert autolinks to the [text](url) form.
What the tool does not do
- It does not convert HTML to Markdown. A bold tag does not become
**text**; the formatting is simply dropped. - It does not decode HTML entities.
,&and similar entities stay as written. - It does not remove tags that span several lines. A tag that opens on one line and only closes its
>on the next is left in place, because matching is done line by line. - It does not delete blank lines left behind by removed tags. Run Markdown Remove Empty Lines or Markdown Minifier afterwards if you want to tighten the spacing.
A sensible clean-up order for exported content
Content exported from a CMS or copied from a web page usually needs more than one pass. A sequence that avoids losing information looks like this:
- Normalise line endings first with Markdown Normalize Line Breaks, so later steps see consistent lines.
- In your editor, convert the HTML you want to keep: important links to
[text](url), meaningful images to, and<br>tags to real line breaks. - Move any command examples that contain angle brackets into fenced code blocks.
- Run this tool to remove the remaining tags.
- Search the output for leftover script or style text and delete it.
- Tighten blank lines left where tags used to be.
Done in this order, the final Markdown keeps everything a reader needs and loses only the markup that was getting in the way.
Good practice
- Keep the original until you have checked the output, especially around images and links.
- Compare the possible HTML tags count before cleaning with a quick search of the output for
<. Anything still there is either inside a code fence, which is intended, or a tag that spans lines and needs manual removal. - Search the result for leftover script or style text.
- Preview the cleaned file with Markdown Previewer to confirm paragraphs and lists still render as intended.
Limitations in short
- Requires a connection; processing is done by the server.
- Maximum 200,000 characters per request.
- Line-based matching: multi-line tags are not removed.
- Anything between angle brackets outside code fences is treated as a tag.
- Element contents, including script and style code, remain as text.
Frequently Asked Questions
FAQ
Comments (0)
Describe the issue you encountered so we can investigate and improve the tool.