Convert HTML to Markdown Online for Free

Reduce an HTML document to portable Markdown while checking the structure, links, and browser-only features that cannot travel.

  1. Add a file Choose or drop it here
  2. Pick the format Change it whenever needed
  3. Download the result After conversion completes

A Browser Sees a Repaired DOM While Markdown Uses a Smaller Language

HTML is the language browsers use to build a document tree, then apply CSS, scripts, fonts, media rules, and layout to that tree. A web page may contain headings, paragraphs, lists, links, images, tables, forms, audio and video elements, custom data attributes, navigation, scripts, and style rules all at once. It can even contain imperfect markup. The HTML Living Standard defines detailed error recovery so browsers can construct a DOM from incorrectly nested or incomplete tags. WHATWG makes an important distinction: browsers must handle many forms of “tag soup,” but that does not make the source conforming HTML. A converter may work from the parsed DOM, the original source, or a simplified extraction, and those starting points can already differ.

Markdown is a plain-text markup syntax with a deliberately narrower set of building blocks. CommonMark 0.31.2 defines blocks such as headings, paragraphs, block quotes, lists, fenced and indented code blocks, thematic breaks, and HTML blocks; its inline rules cover emphasis, code spans, links, images, autolinks, raw HTML, and line breaks. It does not have native CSS, JavaScript, forms, layout positioning, or a general table syntax. GitHub Flavored Markdown adds tables, task lists, strikethrough, and automatic links, but those are extensions, not part of baseline CommonMark.

Converting HTML to MD is therefore a semantic reduction. A real heading can become # through ######; an unordered list can become lines starting with -; an anchor can become [label](URL). But a CSS grid, a hidden navigation panel, a responsive image source set, a form submission target, or a scripted chart has no equivalent in ordinary Markdown. The purpose is to retain useful reading and editing structure, not to recreate a live webpage in a smaller file. Keep the HTML when browser behavior or exact appearance is part of the record.


HTML-to-Markdown Is a Semantic Translation Rather Than a Tag Swap

A strong conversion first needs a sensible document tree. This matters because HTML source text is not always the same as the tree a browser constructs. The HTML parser has defined rules for parse errors, including unexpectedly nested formatting elements and unusual content inside tables. A converter that strips tags with a simple pattern can join words, lose list nesting, or include script and style text. A parser that starts from the browser-style DOM has a better chance of seeing the headings, paragraph boundaries, table cells, and link targets that the page actually exposes. It still has to decide whether to keep sidebars, menus, cookie notices, hidden elements, and repeated footer links.

Next comes a mapping decision. Semantic tags have relatively clear Markdown targets: h1h6, p, strong, em, blockquote, ul, ol, a, img, and pre/code. A conversion of < should emit the actual less-than character or a safe Markdown escape as needed; a code sample needs a fenced block or a code span so punctuation is not parsed as emphasis or a link. CommonMark parsing is not simply “read symbols left to right.” Its documented strategy first determines block structure, then parses inline content, with link reference definitions considered after the block pass. Missing blank lines and indentation can therefore alter the meaning of a converted result.

URLs need their own audit. In HTML, href="../guide" and src="images/logo.svg" are resolved against the page URL or a base element. Once copied into a standalone MD file, those relative references point somewhere else unless the converter resolves them to absolute URLs or the MD is deliberately stored under a matching directory. An image converted to ![label](images/logo.svg) still points to a separate file; it does not embed the image bytes. Links with JavaScript behavior, forms, and buttons cannot be turned into equivalent Markdown interactions at all.


What Remains Useful and What Falls Away in Markdown

  • Headings, paragraphs, quotes, lists, and code usually translate well. CommonMark gives these constructs defined syntax, so the converted text stays readable without a browser.
  • Link labels can survive, but their destinations need checking. Relative URLs may fail after the file moves, and JavaScript-driven links have no Markdown action to preserve.
  • Images normally become references, not copied assets. The MD can name an image URL, but it will disappear if that remote URL changes or the local asset is not included beside the file.
  • CSS and responsive layout fall away. Colors, grids, breakpoints, generated content, hover behavior, and visual order are browser features rather than native Markdown data.
  • Tables depend on the target flavor. CommonMark does not define pipe tables; GFM does, but merged cells and complex nested content still need HTML or a manual rewrite.

Markdown can retain raw HTML in some parsers, including CommonMark's defined HTML block and inline categories. That can be a practical escape hatch for a compact table or an element with no MD form, but it reduces portability and may be filtered by publishing systems for safety. Decide up front whether the target is strict CommonMark, GitHub Flavored Markdown, a notes application, or a documentation generator. “Markdown” without a named renderer is not a complete compatibility requirement.


Parser and Renderer Differences Change the Result

CommonMark exists because early Markdown implementations differed on many ambiguous cases. Its specification supplies a formal parsing strategy and testable rules rather than relying on a vague convention. For example, it distinguishes soft line breaks from hard line breaks, defines how backslash escapes and entities work, and gives nesting rules for lists and block quotes. A conversion that visually resembles Markdown can still render differently if it relies on a renderer-specific shortcut. A line beginning with a number and a period may become a list in one context; asterisks can become literal characters, emphasis, or a thematic break depending on spacing and surrounding lines.

GFM illustrates the boundary. It is a strict superset of CommonMark and adds pipe tables, task-list items, strikethrough, bare-URL autolinks, and filtering of certain raw HTML. A README that looks complete on GitHub may therefore lose its table or task boxes in a CommonMark-only preview. Conversely, leaving raw HTML in converted output may work in a local renderer but be removed by a hosting service that sanitizes dangerous tags and attributes. Test the MD where it will be published, not only in an editor preview that uses a different extension set.

HTML source quality still matters before Markdown rules even begin. WHATWG calls out that invalid markup can result in highly unintuitive DOM trees, especially around tables. One reported converter failure merged the contents of multiple paragraph elements inside a table cell without separators, changing separate values into one run of text. That is a concrete reason to inspect complex tables by hand. A Markdown table is best for a small rectangular data set with simple cell content. For row spans, column spans, embedded paragraphs, nested lists, or layout tables, preserve accessible HTML, create a CSV or a textual list, or rewrite the information instead of trusting an automatic pipe-table result.


Failure Cases Worth Checking Before You Trust the MD

Text disappears or is in an unexpected order. First identify whether the source relies on CSS or JavaScript. A browser can change visual order with layout rules or create content after loading; an HTML-to-MD converter usually reads source or a DOM snapshot, not the fully interactive screen. Work from the main article element when possible, remove navigation and repeated components, and keep the HTML or a PDF when the interface itself carries information.

A nested list becomes flat or code-like. CommonMark uses indentation and blank-line context to decide block structure. Recheck every nested item in the resulting MD, especially around paragraphs inside list items. Use a CommonMark preview if CommonMark is the target, and do not insert tabs merely to make an editor look aligned: the specification gives tabs special expansion rules, which can change the apparent indentation.

A table joins values or loses columns. Inspect table cells that contain several paragraphs, line breaks, lists, rowspan, or colspan. A documented HTML-to-Markdown issue shows multiple paragraphs in one cell being concatenated without any separator. Rewrite such a table as labeled text, use the destination's supported HTML, or choose a data format that models the information directly. Do not claim a pipe table preserves a structure it cannot express.

Links and images break after the MD moves. Resolve relative paths against the original page URL before saving, or package local assets in the expected relative folders. Then test every important link and image in the final location. A readable Markdown file can contain perfectly valid references that no longer lead anywhere.


HTML and Markdown: Capabilities at a Glance

DetailHTMLMarkdown / CommonMark
Primary modelParsed document tree for browsersPlain-text blocks and inline syntax
Layout and styleCSS can control presentation and orderNo native CSS layout model
Interactive featuresForms, scripts, media controls, custom behaviorNo native interactive equivalent
TablesRows, cells, spans, nested contentNot in CommonMark; basic pipes in GFM
Relative referencesResolve against page URL or baseMust resolve from the MD file location
Malformed inputHTML parser has defined recovery rulesRenderer applies its Markdown grammar

Questions to Answer Before Replacing HTML with MD

Will HTML-to-Markdown preserve my webpage exactly?
No. It can preserve meaningful text structure, links, and simple images, but not CSS-driven appearance, scripts, forms, responsive behavior, or every kind of table. Keep HTML for a live page and PDF for a visual record.

Why does a converted table look different on GitHub and another preview?
Pipe tables are a GFM extension, not part of CommonMark. Check the renderer and avoid automatic conversion for cells with spans, several paragraphs, or nested content.

Can I leave HTML inside the Markdown?
CommonMark recognizes raw HTML categories, but a destination may filter or sanitize it. Raw HTML is useful only after checking the target's policy and should not be the silent fallback for important content.

Why did my images stop working after conversion?
The MD probably kept a relative or remote image reference instead of copying the image. Resolve relative paths before moving the file and include local assets with the export.