HTML to Markdown Converter
CodeConvert HTML to Markdown instantly in your browser. Handles headings, links, lists, bold, italic, code blocks, and blockquotes. No data uploaded.
What is a HTMLโMD?
An HTML to Markdown formatter converts HTML markup into readable Markdown syntax. It transforms tags like <h1>, <strong>, <a href="...">, <ul>/<li>, and <pre><code> into their Markdown equivalents โ #, **, [text](url), - item, and fenced code blocks โ producing clean plain text that any Markdown-aware platform can render correctly.
HTML and Markdown solve the same problem โ representing formatted text in plain-text files โ but Markdown is far easier to write and read. HTML is the native format of the web browser; Markdown is the native format of developer documentation, technical blogs, wikis, and modern headless CMS platforms. As teams migrate content from legacy HTML-heavy CMSes to Markdown-based systems (Notion, Obsidian, Ghost, Hugo, Docusaurus), the need to convert existing HTML content without manual reformatting is a common, practical problem.
The formatter handles the most common prose elements: six levels of headings, bold and italic emphasis, inline and block code, hyperlinks, images, ordered and unordered lists, blockquotes, and horizontal rules. It decodes HTML entities so & becomes & in the output, and strips non-content tags like <script>, <style>, and <meta> automatically. Use it alongside the Markdown to HTML Formatter for the reverse workflow, or the Markdown Formatter to clean up the Markdown output.
How to use this HTMLโMD calculator
- Copy the HTML you want to convert โ a full page, an article body, or a fragment.
- Paste it into the HTML Input field.
- The Markdown output updates instantly. Review it for any elements that did not convert as expected.
- If links or images are missing, check that the source HTML used proper
hrefandsrcattributes rather than JavaScript-driven navigation. - Copy the Markdown output and paste it into your target platform, documentation file, or Markdown editor.
Formula & Methodology
The converter applies a sequential rule-based substitution pipeline: 1.<pre><code>blocks are extracted first and converted to fenced code blocks (```). 2. Headings h1โh6 are replaced with the corresponding number of#characters. 3. Block elements:<blockquote>,<hr>are converted. 4. List containers<ul>and<ol>with their<li>items are converted. 5. Inline elements:<strong>,<b>,<em>,<i>,<code>,<a>,<img>,<br>. 6.<p>tags are converted to paragraph breaks. 7. Remaining HTML tags are stripped. 8. HTML entities are decoded. 9. Multiple consecutive blank lines are collapsed to a single blank line. Before/after example: Input:html <h2>Getting Started</h2> <p>Install with <code>npm install zod</code>. See the <a href="/docs/">docs</a>.</p> <ul><li>Fast</li><li>Type-safe</li></ul>Output: ```markdown
Frequently Asked Questions