HTML to Markdown
Convert HTML code to clean Markdown text.
How to use HTML to Markdown
Paste your HTML code
Click the left text area labeled 'HTML Input' and paste your HTML code. You can paste entire HTML documents, snippets, or individual elements. The text area accepts unlimited content length.
Click the Convert button
Press the blue 'Convert to Markdown' button located between the two text areas. The tool instantly processes your HTML and generates clean Markdown syntax without any additional configuration needed.
Copy the Markdown output
Your converted Markdown appears in the right text area labeled 'Markdown Output'. Click the 'Copy' button in the bottom-right corner to copy all converted text to your clipboard instantly.
Paste into your editor
Open your Markdown editor, documentation tool, or CMS and paste the converted content using Ctrl+V (Windows) or Cmd+V (Mac). The formatting preserves all headings, lists, links, bold, italic, and code blocks.
Related Tools
HTML to Markdown converter: clean output in one click
HTML to Markdown converter: clean output in one click
An HTML to Markdown converter takes raw HTML markup and produces clean, readable Markdown syntax instantly in your browser, handling headings, links, lists, tables, code blocks, and bold or italic text. Use the free ToolHQ HTML to Markdown converter to convert any HTML in seconds.
An HTML to Markdown converter is a browser-based developer tool that parses HTML tags and attributes and outputs semantically equivalent Markdown syntax following the CommonMark specification.
Most content ends up in more than one place. A blog post written in a CMS, a document in a wiki, a README file in a repository, a message in a Markdown-based chat tool. When the source is HTML and the destination expects Markdown, hand-converting every tag is slow and error-prone. A converter does it in one step, and because it runs entirely in your browser, your code never leaves your device.
Key takeaways
- Converts headings, paragraphs, links, bold, italic, tables, lists, blockquotes, and code blocks
- Handles nested HTML elements and complex structures that trip up manual conversion
- Browser-based: your code never leaves your device
- Output follows CommonMark, the widely supported Markdown standard
- Free, instant, no account needed
What Markdown is and why the conversion matters
Markdown is a lightweight plain-text formatting syntax created by John Gruber in 2004. It uses simple symbols: ** for bold, # for headings, > for blockquotes, and so on. The appeal is readability in raw form and easy conversion to HTML for display.
The CommonMark specification standardizes Markdown syntax so it behaves consistently across different parsers, from GitHub to Obsidian to documentation generators.
HTML and Markdown solve the same problem: formatting structured text. But they are used in different contexts:
- HTML is used in web browsers, email clients, and CMS platforms that render markup
- Markdown is used in documentation tools (GitHub, GitLab, Confluence), static site generators (Hugo, Jekyll), note-taking apps (Obsidian, Notion), and README files
The conversion is not purely mechanical. Some HTML structures have clean Markdown equivalents; others do not. Inline CSS styles, for example, have no Markdown equivalent. A good converter makes intelligent decisions: it preserves semantic meaning (what the content is) while stripping presentational markup (how it looks).
ToolHQ's converter handles the most complex cases that trip up simpler tools: tables with multiple columns, nested lists, code blocks with language hints, links with titles, and inline code inside headings or lists.
When HTML-to-Markdown conversion is useful
Migrating content from a CMS to a Markdown-based platform. If you are moving a blog from WordPress to a static site generator, or migrating documentation from Confluence to GitHub Wiki, the content exists as HTML and needs to become Markdown. Converting manually is feasible for one or two pages and impractical for 50.
Copying web content into a Markdown editor. Developers often want to paste a portion of web content into their documentation without the HTML. Select the HTML source, paste it into the converter, and get clean Markdown.
Extracting structured content from emails. Many email clients use HTML formatting. Pasting an HTML email into the converter produces plain, readable Markdown that can be saved in a notes app or documentation system.
Cleaning up pasted content from rich text editors. When you paste content from Word, Google Docs, or a web browser into a rich text editor, the result is often messy HTML. Converting to Markdown and back through your preferred renderer gives you a clean intermediate form.
Processing CMS exports for documentation pipelines. Developers building documentation sites from CMS content often need an HTML-to-Markdown step in their workflow. The ToolHQ converter handles this interactively for small batches.
Mini-story: Nina, a 32-year-old technical writer in Berlin, was migrating her company's internal documentation from a legacy Confluence instance to a GitHub repository where content would be maintained as Markdown files. She had 45 pages to convert. She wrote a script to pull the HTML from the Confluence API, but for the initial testing phase she ran 10 pages through the ToolHQ HTML to Markdown converter to validate the output quality. The converter correctly handled the nested bullet lists, code blocks with syntax hints, and inline links. Critically, it also stripped the inline CSS classes that Confluence adds to its markup, leaving clean Markdown that her static site generator parsed without errors.
Convert your HTML to Markdown now
How to use the HTML to Markdown converter: step by step
Paste your HTML. Copy raw HTML from your source, a CMS, a page's source code, or your editor's HTML output, and paste it into the input field on the left side of the converter.
Review the Markdown output. The converter instantly renders the Markdown equivalent in the right panel. For most content, conversion happens as you type without needing to click a button.
Check complex elements. Scan through the output for tables, nested lists, and code blocks. These are the most likely to need review. Confirm links have the correct text and URL.
Copy the Markdown. Click the copy button to put the output on your clipboard. Paste it into your target editor, repository, or documentation tool.
Clean up any remnants. Very complex HTML with inline styles or non-semantic markup may produce some formatting artifacts. The word counter and text case converter are useful for any quick cleanup of the output.
Tips for clean HTML-to-Markdown conversion
Start with semantic HTML for the best results. The converter works from HTML semantics: <h1> becomes #, <strong> becomes **, <ul> becomes a bulleted list. HTML that relies on CSS classes for visual formatting rather than semantic tags will lose its formatting in conversion, since Markdown has no concept of CSS classes.
Remove inline styles before converting. Inline style="..." attributes have no Markdown equivalent and are stripped by the converter. If the visual formatting relies on inline styles rather than semantic HTML elements, review the output carefully to ensure the meaning is preserved.
Tables convert to Markdown pipe tables. Most Markdown parsers support pipe table syntax (GitHub Flavored Markdown). If your target platform uses a different table format, the output may need adjustment. Verify the table renders correctly in your destination tool.
Code blocks preserve language hints. If the HTML uses <pre><code class="language-python">, the converter outputs a fenced code block with the language hint: ```python. This is supported by most Markdown renderers.
Mini-story: Carlos, a 26-year-old developer in Madrid, was building a documentation site from a large body of internally written HTML documentation. He used the ToolHQ HTML to Markdown converter to convert several test pages and discovered that the inline code spans, wrapped in <span> tags with a CSS class rather than <code> tags, were not converting correctly. He updated the HTML export template to use proper <code> tags instead of styled spans. After that change, all inline code converted correctly to Markdown backtick syntax.
For developers working with structured data formats, the HTML formatter helps clean up HTML before conversion, and the JSON formatter is useful for documentation that includes JSON data structures alongside Markdown content.
Frequently asked questions
What is the difference between HTML and Markdown?
HTML uses angle-bracket tags (<h1>, <p>, <a>) to define structure and links. Markdown uses simpler text symbols (#, **, [text](url)) that are easier to read and write. Both are converted to HTML for display in browsers.
Does the converter handle tables?
Yes. HTML tables are converted to Markdown pipe table syntax, which is widely supported by GitHub, GitLab, and most Markdown-based documentation tools. Complex merged cells may not convert perfectly since Markdown pipe tables do not support cell merging.
Can it convert a full webpage?
The converter works on any HTML you paste in. For a full webpage, paste the HTML from the page source. However, navigation, sidebars, and other layout elements will also convert, so you may want to paste only the main content section rather than the full document.
Is the conversion reversible?
Mostly. The ToolHQ markdown-to-HTML converter converts in the other direction. However, some information present in HTML (inline styles, IDs, data attributes) does not survive HTML-to-Markdown and back.
What happens to images during conversion?
HTML <img> tags convert to Markdown image syntax: . The alt attribute becomes the alt text and the src attribute becomes the URL. However, HTML image attributes like width, height, class, and style have no Markdown equivalent and are dropped. If your HTML has images sized via CSS or HTML attributes, the output Markdown images will display at their natural dimensions when rendered. Some Markdown flavors (like GitHub Flavored Markdown) have no standard syntax for setting image dimensions; you would need to revert to an HTML <img> tag within the Markdown for size control.
Is my code safe?
Yes. All conversion happens in your browser. Your HTML is not sent to any server, and no code is stored or transmitted.
The short version
An HTML to Markdown converter saves the time and error risk of converting markup manually, particularly for tables, nested lists, and code blocks that are tedious to rewrite by hand. ToolHQ's free converter runs entirely in your browser, handles complex HTML structures cleanly, and follows the CommonMark standard for maximum compatibility with Markdown tools.
Paste your HTML, review the output, and copy the Markdown in seconds.
If you need to go the other direction, the markdown-to-HTML tool converts your Markdown back to HTML. The HTML formatter keeps your source HTML readable before and after conversions. Browse all developer tools on ToolHQ.