HTML to Markdown Converter

Markdown output will appear here

Paste HTML on the left or load a sample

READY
LN 1, COL 10 CHARS

About the HTML to Markdown Converter

The HTML to Markdown Converter turns HTML into Markdown in your browser, using the Turndown library plus table, strikethrough, and task-list rules written for this page. Paste HTML source, paste rich text copied from a web page or a document, or drop an `.html`, `.htm`, or `.txt` file. Use it to move a blog post into a static site generator, turn an exported help page into a README, or clean up copied web content before it goes into a wiki. The HTML is parsed into a detached, inert document: scripts do not run and images or frames are not loaded. Conversion runs in your browser and nothing is sent to our servers or analytics. The input is not saved in the page address; it goes into a link only when you click Share, so avoid sharing pages that contain private content.

Updated: November 13, 2026

How to use the converter

  • Paste HTML into the input area, or drop an `.html`, `.htm`, or `.txt` file onto it. The Markdown appears on the right about 300 ms after you stop typing.
  • You can also paste rich text. When the clipboard holds formatted content (for example, text copied from a web page or Word) and its plain-text version does not itself contain HTML tags, the formatted HTML is inserted, and it is converted to Markdown. If the plain text already contains tags, such as HTML copied from a code editor, it is pasted as written.
  • Pick the output style with the toolbar: ATX (`# Title`) or Setext (underlined) headings, a `-`, `*`, or `+` bullet marker, fenced or indented code blocks, a ``` or ~~~ fence, `_` or `*` for italic, `**` or `__` for bold, and inline or referenced links. The choices are saved in the page address.
  • Copy the result, or click Save to download it as `converted.md`.

What is converted, and what is removed

  • Headings, paragraphs, emphasis, links, images, block quotes, ordered and unordered lists, inline code, and horizontal rules use the Turndown defaults for your chosen style.
  • Tables become GFM pipe tables. The first row is used as the header row, even when it has no `th` cells; column alignment is read from the `align` attribute, short rows are padded, and a `|` inside a cell is escaped. A table with merged cells (`colspan`, `rowspan`) is flattened, because Markdown tables cannot merge cells.
  • A `pre` block holding a `code` element with `class="language-xxx"` keeps its language after the opening fence, for example ```js. `del`, `s`, and `strike` become `~~strikethrough~~`, and a checkbox at the start of a list item becomes `[x]` or `[ ]`.
  • The content of `script`, `style`, `noscript`, `iframe`, and `template` elements is dropped. The `head` of a full document, including its `title`, is ignored; only the `body` is converted.
  • Markdown cannot express everything HTML can. Other HTML elements are replaced by their text content, and inline styles, classes, and attributes are lost.

Worked example

  • Input: `<h2>Install</h2><pre><code class="language-bash">npm install my-package</code></pre><table><tr><th>Option</th><th align="right">Default</th></tr><tr><td>retries</td><td align="right">3</td></tr></table>`
  • Output: a `## Install` heading, a fenced block that starts with ```bash, and a table with the lines `| Option | Default |`, `| --- | ---: |`, and `| retries | 3 |`.
  • Click Sample to load a longer example with a checklist, a link, a code block, a table, and a script that is removed.

Privacy and security

The HTML is parsed by the browser's `DOMParser` into a document that is never attached to the page you are viewing. Scripts and event handlers in the pasted HTML do not run, and images, stylesheets, and frames are not requested, so pasting a web page does not contact the sites it references. The input is never rendered as HTML in this page; the output is shown as plain text. Nothing is sent to our servers or analytics. Your style choices are saved in the page address as you change them; the pasted HTML is not, so it is not sent to our CDN on reload and does not stay in browser history. The HTML goes into a link only when you click Share. Long input is compressed with lz-string, which is not encryption, so anyone with the link can read it. Links in the Markdown, including `javascript:` URLs found in the source, are copied as written, so check them before publishing the result.

Tips and pitfalls

  • Convert only the part you need. A full web page includes navigation, footers, and cookie banners, which become Markdown too. Copy the article body, or paste just that element's HTML.
  • Relative links and image paths stay relative. A link such as `/docs/start` is not turned into a full URL, so add the site address yourself if the Markdown will live elsewhere.
  • Pages rendered by JavaScript. Pasting "view source" HTML of a client-rendered page often gives an empty shell. Copy the rendered content from the page instead, or use the browser's "Copy outerHTML" in the developer tools.
  • Markdown flavors differ. Pipe tables, strikethrough, and task lists are GFM (GitHub Flavored Markdown) features; a renderer that follows only the original Markdown will show them as plain text. Check the result in the Markdown Preview tool.
  • Characters such as `*`, `_`, and `#` in text are escaped with a backslash so they are not read as formatting.

Frequently Asked Questions

Is my HTML uploaded anywhere?
No. The conversion runs in your browser tab and nothing is sent to our servers or analytics. The pasted HTML is not written to the page address either; it goes into a link only when you click Share.
Can pasted HTML run scripts or load images?
No. The HTML is parsed with `DOMParser` into a separate, inert document that is not attached to the page. Scripts and event handlers do not run, and images, stylesheets, and frames are not fetched. The content of script, style, noscript, iframe, and template elements is also removed from the output.
Are tables supported?
Yes, as GFM pipe tables. The first row becomes the header row, `align` attributes set the column alignment, and pipes inside cells are escaped. Merged cells (`colspan`, `rowspan`) are flattened, and a table is only as good as GFM allows: cells cannot hold block content, so line breaks inside a cell become spaces.
How do I keep the language of a code block?
Put the language on the `code` element inside `pre`, as `class="language-js"`. The converter writes it after the opening fence (```js). If the code block style is set to Indented, the language cannot be shown, because indented blocks have no info string.
Why does my pasted text come out as Markdown even though I did not paste HTML?
When you paste formatted content, such as text copied from a web page or Word, the browser provides an HTML version, and the converter uses it. If the plain text on the clipboard already contains HTML tags, as when you copy source from a code editor, it is pasted as plain text instead.
Which Markdown flavor does the output use?
CommonMark-style Markdown with the GFM extensions for tables, strikethrough, and task lists. Use the Markdown Preview tool to check how it renders.