HTML to Markdown Converter

Paste HTML, or choose a .html file, and get clean GitHub Flavored Markdown back: headings, links, lists and tables kept, scripts and styles stripped.

Or drop an HTML file here. It is read on your device and never uploaded.

How to use this tool

  1. Paste HTML into the box, for example a page's source viewed with "View Page Source" or "Inspect", or choose a .html file. Or press "Try an example".
  2. Read the result in the Markdown box. It updates as you type.
  3. Press "Copy Markdown", or download the result as a .md file.

What each HTML element becomes

The converter keeps the structure HTML elements describe, headings, emphasis, links, lists, code and tables, and writes it as GitHub Flavored Markdown. Each result below was produced by the converter itself.

HTMLYou pasteMarkdown you get
Heading<h2>Results</h2>
## Results
Bold and italic<strong>Done</strong> and <em>nearly</em>
**Done** and *nearly*
Strikethrough<s>draft</s> final
~~draft~~ final
Hyperlink<a href="https://commonmark.org/">CommonMark</a>
[CommonMark](https://commonmark.org/)
Inline codeRun <code>npm test</code>
Run `npm test`
Bulleted list<ul><li>milk</li><li>eggs</li></ul>
- milk
- eggs
Numbered list<ol><li>Plan</li><li>Write</li></ol>
1. Plan
2. Write
Block quote<blockquote>Measure twice</blockquote>
> Measure twice
Code block<pre><code class="language-js">let a = 1;</code></pre>
```js
let a = 1;
```
Table without its own header row<table><tr><td>Item</td><td>Qty</td></tr><tr><td>Pens</td><td>4</td></tr></table>
| Item | Qty |
| ---- | --- |
| Pens | 4   |
A bare line breakone<br>two
one\
two
A <script> tag<script>track()</script>
(removed)

Example: release notes before and after

Before: the HTML

<h1>Release notes</h1>
<p>Version 2.0 adds <strong>dark mode</strong> and fixes a <em>sign-in</em> bug.</p>
<!-- internal note: remove before publishing -->
<ul>
  <li>Dark mode toggle in Settings</li>
  <li>Faster search</li>
</ul>
<table>
  <tr><td>Plan</td><td>Price</td></tr>
  <tr><td>Starter</td><td>$9</td></tr>
  <tr><td>Team</td><td>$29</td></tr>
</table>
<p>Read the <a href="https://commonmark.org/help/">full changelog</a>.</p>
<script>trackEvent('viewed_notes');</script>

After: Markdown

# Release notes

Version 2.0 adds **dark mode** and fixes a *sign-in* bug.

- Dark mode toggle in Settings
- Faster search

| Plan    | Price |
| ------- | ----- |
| Starter | $9    |
| Team    | $29   |

Read the [full changelog](https://commonmark.org/help/).

The comment and the <script> tag in the HTML do not appear on the right: both are removed before the Markdown is written.

Why convert HTML to Markdown

HTML is built for browsers to render, with opening and closing tags around everything and attributes that have nothing to do with the words themselves. Markdown is built for people to read and write directly: a heading starts with #, a link is [text](url), and most of a page's prose needs no markup at all. That makes Markdown the format documentation sites, READMEs, note apps and most static site generators expect, and the format large language models read most reliably when you feed them a page's content rather than its tag soup.

Pasting rendered text out of a browser tab loses structure: headings become plain lines, a bulleted list loses its bullets, and a table collapses into run-on text. Converting the page's own HTML instead keeps the structure the tags describe, because the converter can see which text was a heading, which belonged to a list and which cells made up a table.

How it works, and why pasted HTML cannot run anything

The text you paste is read by a text parser, hast-util-from-html, which turns HTML into a tree the way a browser's HTML parser would, but it is not a browser: it never creates an actual page element, never fetches an image, and never executes a <script>. The same code already reads the HTML that the DOCX to Markdown tool gets from Word documents. On top of that, this tool deletes every <script> tag, <style> tag and HTML comment before the tree is turned into Markdown, so none of their contents can leak into the result even by accident.

What remains is turned into Markdown following GitHub Flavored Markdown: headings become #through ######, <strong> and <em> become **bold**and *italic*, lists keep their numbers or get a hyphen, and a <table> becomes a pipe table with a header row.

Private by design

The HTML never leaves your device. It is parsed and converted by code already loaded into this page, and the Markdown is shown in the box above. There is no upload, no account and no copy kept on a server, which matters for an internal page, a draft newsletter or anything else you would not paste into a stranger's website.

Limits

  • Layout, fonts, colours and anything done with CSS are not converted; Markdown has nowhere to put them. <style> blocks and inline style attributes are ignored.
  • <script> tags and their contents are removed entirely, and never run.
  • Tables become pipe tables with one line per cell: a cell holding several paragraphs or a line break is joined onto one line, because a Markdown table cell cannot hold either. A table with no <th> cells of its own gets a header from its first row.
  • Merged table cells (colspan and rowspan) are not merged back together; each cell is written on its own.
  • Forms, embedded video, iframes and SVG are left out, since Markdown has no equivalent for them.
  • An <img> with no address to point to (no src) is left out and counted, not guessed at.

Frequently asked questions

Is my HTML uploaded anywhere?

No. The converter is a small program that runs inside this page, in your browser. Your HTML is never sent to a server, and it keeps working if you go offline after the page has loaded.

Is it safe to paste HTML from a page I do not fully trust?

Yes. The HTML is read by a text parser, the same kind used by the DOCX to Markdown tool, not by the browser's own page renderer: it never creates real page elements, never runs a &lt;script&gt;, never loads an &lt;img&gt;, and never applies a &lt;style&gt;. On top of that, this tool deletes every &lt;script&gt;, &lt;style&gt; and HTML comment before writing the Markdown, so none of their contents can appear in the result.

Can I convert a whole web page?

Yes, if you paste its HTML source rather than a link: open the page, use your browser's "View Page Source" or "Inspect" and copy the markup, then paste it here. The tool does not fetch pages itself, so a URL alone will not work.

Does it work with HTML copied from Word or Google Docs?

It accepts it, but results vary. Saving from Word as "Web Page, Filtered" or using Google Docs' File, Download, Web Page (.html) option, then pasting that file's contents, converts cleanly: headings, bold, links, lists and tables come through. For the document itself, the DOCX to Markdown Converter reads Word's own styles directly and keeps more structure.

What does the tool do with a table that has no explicit header row?

GitHub Flavored Markdown's table format always needs a header row, so if the HTML table has no &lt;th&gt; cells at all, its first row becomes the header. A table that already marks a header with &lt;th&gt; or &lt;thead&gt; is left exactly as written.

Is it free?

Yes, with no sign-up and no limit on how much HTML you convert. Pro, planned as a one-time purchase, adds converting a whole folder of .html files at once.