HTML to Markdown Converter

Paste your HTML to convert it to clean, readable Markdown instantly.

About This Tool

The HTML to Markdown Converter is a free, browser-based utility that transforms HTML markup into clean, readable Markdown. Whether you are migrating content from a CMS to a static site generator, converting documentation for a GitHub repository, or simply cleaning up HTML copied from a web page, this tool handles the conversion instantly and accurately.

All processing happens entirely in your browser using the native DOMParser API. No data is transmitted to any server, making it safe for sensitive content such as internal documentation, proprietary code snippets, and private correspondence. There is no signup, no rate limiting, and no analytics on your input data.

The converter supports a comprehensive set of HTML elements including headings (h1 through h6), bold and italic text, links, images, ordered and unordered lists (with nesting), code blocks and inline code, blockquotes, horizontal rules, tables, and strikethrough text. It walks the DOM tree recursively to handle deeply nested structures and complex formatting combinations.

You can customize the output style to match your preferred Markdown conventions. Choose between ATX-style headings (using # symbols) or Setext-style (using underlines for h1 and h2). Select inline links or reference-style links for cleaner body text. Pick fenced code blocks (triple backticks) or indented code blocks (four-space indent). These options let you produce Markdown that integrates seamlessly with your existing documentation workflow.

How to Use

  1. Paste or type your HTML into the HTML Input panel on the left.
  2. The Markdown Output panel on the right updates in real time as you type.
  3. Adjust conversion options using the dropdowns at the top: Heading style, Link style, and Code block style.
  4. Click Sample to load example HTML and see how the converter handles various elements.
  5. Click Copy or press Ctrl+Shift+C to copy the Markdown output to your clipboard.
  6. Click Clear to reset both panels and start fresh.

Popular HTML to Markdown Examples

View all HTML to Markdown examples →

FAQ

Is my data safe?

Yes. All conversion happens client-side in your browser using the native DOMParser API. No data is sent to any server, and there is no logging or analytics on your input. It is safe for sensitive and proprietary content.

What HTML elements are supported?

The converter supports headings (h1-h6), bold (<strong>, <b>), italic (<em>, <i>), links (<a>), images (<img>), ordered and unordered lists with nesting, code blocks (<pre><code>), inline code (<code>), blockquotes, horizontal rules, tables with headers, line breaks, paragraphs, and strikethrough (<del>, <s>).

What is the difference between ATX and Setext headings?

ATX headings use hash symbols (# Heading 1, ## Heading 2, etc.) and support all six levels. Setext headings use underlines: === for h1 and --- for h2. Setext only works for the first two heading levels; h3 through h6 always use ATX style regardless of the setting.

What are reference-style links?

Inline links include the URL directly: [text](https://example.com). Reference-style links use a numbered or named reference: [text][1] with the URL defined at the bottom of the document as [1]: https://example.com. Reference style keeps the body text cleaner and is easier to maintain when the same URL is used multiple times.

Can it handle malformed or partial HTML?

The tool uses the browser's built-in DOMParser, which is very forgiving with malformed HTML. Missing closing tags, improperly nested elements, and HTML fragments are handled gracefully. The parser fixes the structure before conversion, producing the best possible Markdown output.

Does it support Markdown tables?

Yes. HTML tables with <table>, <thead>, <tbody>, <tr>, <th>, and <td> elements are converted to GitHub Flavored Markdown (GFM) table syntax with proper alignment separators. Tables without an explicit <thead> use the first row as the header.

What keyboard shortcuts are available?

Press Ctrl+Shift+C to copy the Markdown output to your clipboard without needing to click the Copy button.

Related Tools