HTML to Markdown converter

Paste HTML or a copied web page, get clean Markdown. Semantic tags map to Markdown, inline styles are dropped, tables and code blocks survive. Free, in your browser.

Free · no sign-up
## Release notes v2.4

        This release **removes** the legacy exporter and *adds* a [webhook API](https://example.com/docs/webhooks).

        - Faster cold start
        - New `--dry-run` flag

        | Endpoint | Method |
        |---|---|
        | /v2/export | POST |
        | /v2/status | GET |

        ```bash
        curl -X POST https://api.example.com/v2/export \
          -H "Authorization: Bearer $TOKEN"
        ```

        Posted by the platform team
Converted in your browser. Your file never leaves your device.
1

Paste HTML

Paste raw HTML source, or select part of a web page, copy, and paste. The clipboard carries the HTML either way.

2

Check the Markdown

The right pane shows the exact .md output. Pick heading style, inline or reference links, and the fence character.

3

Download .md

Save the file or copy it into your notes, a README or a docs repo. Nothing was uploaded.

How HTML maps to Markdown

HTML has around a hundred elements. Markdown has a dozen constructs. An HTML to Markdown converter is really a set of decisions about which elements carry meaning, which carry only presentation, and what to do with the ones Markdown cannot express. MDtoDOCX makes those decisions in the open so the output is predictable.

Semantic tags become Markdown

<h1> to <h6> become # to ######. <strong> and <b> become **bold**; <em> and <i> become *italic*; <del> and <s> become ~~strikethrough~~. <a href> becomes [text](url), <img> becomes ![alt](src) with the alt attribute preserved. <ul>, <ol> and nested <li> become indented lists, with the start attribute respected. <blockquote> becomes > lines, <hr> becomes ---, and a <br> inside a paragraph becomes a hard line break. Loose lists, where each item is wrapped in <p>, stay loose so the blank lines between items are kept.

Inline styles are discarded on purpose

Colours, font sizes, margins and font-family have no Markdown equivalent, so style attributes are dropped along with class and id. Wrapper elements that carry no meaning, such as <div>, <span>, <font> and <center>, are unwrapped and their text flows into the surrounding block. There is one deliberate exception: a <span> whose only styling is font-weight: bold or font-style: italic is treated as <strong> or <em>, because that is exactly how Google Docs and Word emit emphasis when you copy from them. <script>, <style>, <nav>, <aside>, <head> and HTML comments are removed entirely, which is why pasting a whole article page usually gives you just the article.

Whitespace is normalised, except inside <pre>

Browsers collapse runs of spaces and newlines in ordinary HTML, so the converter does the same: any run of whitespace outside a preformatted block becomes a single space, and text nodes that are only whitespace between block elements are removed. Inside <pre> every character is kept. This is what stops indented HTML source from turning into indented, accidental code blocks in the Markdown.

Tables

A <table> with a <thead> or a first row of <th> becomes a pipe table with that header. If there is no header row, the first row is promoted so the table is valid GitHub Flavored Markdown. Column alignment is read from align attributes or text-align styles and written as :---, :---: or ---:. A pipe character inside a cell is escaped as \|. When a cell contains block content, a list, several paragraphs, or a nested table, or when any cell uses colspan or rowspan, a pipe table would lose information, so that table is emitted as HTML instead. Nothing disappears silently.

Code blocks and their language

<pre><code> becomes a fenced block. The language is taken from class="language-bash", lang-bash, or the highlight.js and Prism conventions, so the fence reads ```bash. The <span> elements that syntax highlighters wrap around tokens are stripped, entities such as &lt; are decoded back to <, and if the code itself contains three backticks the fence is lengthened to four. Inline <code> becomes single backticks, doubled when the content contains a backtick.

Copying from a page versus pasting source

When you select part of a web page and copy, the browser puts the rendered HTML fragment on the clipboard, already free of scripts and site chrome. Pasting that fragment is usually the cleanest path. Pasting raw source works too, including a full document with <html> and <head>. Converting directly from a URL needs a server-side fetch, because browsers block cross-origin reads, so that option is part of Pro. Everything else here runs in your browser, and the HTML is never uploaded.

MDtoDOCX vs Pandoc vs copy-paste

What mattersMDtoDOCXPandocCopy into a Markdown editor
Semantic tags to MarkdownYes, h1–h6, lists, quotes, links, imagesYesPlain text only
Inline stylesDropped; bold and italic spans recognisedDroppedLost
TablesPipe table; HTML kept for spansPipe or grid tableTabs
Code language from classYesPartiallyNo
Scripts, nav, sidebars removedYesScripts onlyDepends on selection
Paste a page fragmentYesNo, file or URLYes
Install anythingNoYesNo
PrivacyLocal, nothing uploadedLocalLocal

Frequently asked questions

Can I paste a whole web page into the HTML to Markdown converter?
Yes. Select the part you want, copy, and paste. The clipboard carries the rendered HTML, and scripts, navigation, sidebars and style sheets are removed automatically, so you usually get just the article body.
Are inline styles like colour and font size kept?
No. Markdown cannot express them, so style attributes are dropped. Spans that are only bold or italic are converted to ** and *, which is how Google Docs and Word mark emphasis when you copy from them.
What happens to elements Markdown does not support?
Wrappers such as div and span are unwrapped and their text is kept. Elements with no text value, such as iframe, video, form and svg, are dropped. Pro's Keep raw HTML option writes them into the Markdown as HTML instead, which most renderers pass through.
How are tables with merged cells handled?
A table with colspan or rowspan, or with lists or multiple paragraphs inside a cell, is emitted as an HTML table so nothing is lost. Simple tables become pipe tables with the header row and column alignment preserved.
Does it detect the code language?
Yes, from class names such as language-python, lang-python and the highlight.js and Prism conventions. Highlighter span elements are stripped and HTML entities decoded, so the code in the fence is exactly what was displayed.
Can I convert a URL directly?
Pasting works for any page you can open. Converting from a URL requires a server to fetch the page because browsers block cross-origin reads, so it is a Pro feature. It extracts the main content and skips the site chrome.
Are links and images preserved?
Yes. Links become [text](url) with relative URLs kept as they were, or made absolute if you pasted from a page with a known origin. Images become ![alt](src) with alt text. Choose Reference links in the options to collect URLs at the bottom of the file.
Is html to md conversion free and private?
Free, no account, no daily limit. The HTML is parsed in your browser and never uploaded. Pro adds URL fetching, raw HTML pass-through and batch conversion of many files.
Can I convert the Markdown on to Word or PDF?
Yes. Switch the output to Word (.docx) in the format bar, or take the Markdown to the Markdown to Word converter or Markdown to PDF for full layout options.