Free HTML to Markdown Converter
Last updated: November 16, 2026
Quick answer: HTML is the publishing format and Markdown is the authoring format — and moving content between them by hand is slow, error-prone work: a missed closing tag here, a flattened table there, a list that loses its nesting. This free HTML to Markdown converter does the move for you: paste your HTML or upload the file and it returns clean GitHub-flavoured Markdown — headings, bold and italic, links, images, nested lists, blockquotes, fenced code blocks and tables, all converted by a real DOM parser, not by regex tag-stripping. Choose ATX or Setext headings and inline or reference-style links, then copy the result or download it as .md. Everything runs in your browser, so your documents never leave your device.
Conversions: headings become # to ###### (or === / --- for h1/h2 in Setext mode); <strong>/<b> become **bold**, <em>/<i> become *italic*, <s>/<del> become ~~strikethrough~~; links become [text](url) or [text][1] with definitions appended; images become ; <code> becomes `code` and <pre> becomes a fenced block (language detected from class="language-..."); nested lists keep their depth with two-space indents; tables become GitHub-style tables; blockquotes, horizontal rules and line breaks are preserved. Dropped honestly: inline styles, classes, ids, data attributes, and script/style content are not carried over — Markdown has no place for them. Complex nested tables flatten to plain text. Your HTML is parsed locally — nothing is uploaded.
✓ Free forever · ✓ No signup · ✓ Tool inputs stay in your browser — never sent to our servers.
How to Use the HTML to Markdown Converter
- Paste your HTML into the box, or use the file picker to load an .html / .htm file — the contents load into the editor automatically. Full documents work, not just fragments: the converter reads the body and ignores the head, scripts and styles.
- Pick your heading style. ATX (# Heading) is the default and the style GitHub, most static-site generators and most editors expect. Setext (Heading followed by === or ---) matches older Markdown and some documentation styles — it only applies to h1 and h2; deeper headings stay ATX either way.
- Pick your link style. Inline links ([text](url)) are the default and the easiest to read in place. Reference-style links ([text][1] with definitions at the end) keep long URLs out of the prose, which helps when the same URL appears several times or the document will be edited by hand.
- Press Convert to Markdown. The result appears instantly with a line/word count and the number of elements converted. Copy it or Download .md and drop it straight into your repo, CMS, or notes app.
- Check the tables and code blocks before you publish: tables become GitHub-style tables with a header row, and fenced code blocks keep their language when the HTML carries a class like language-python. The note under the output lists every conversion rule, so nothing about the output should surprise you.
Why Use Our HTML to Markdown Converter?
- Real DOM parsing, not regex — the HTML is parsed into a document tree and walked node by node, so nested lists keep their depth, a link inside a list item stays inside the list item, and a code block inside a blockquote stays quoted. Regex tag-strippers flatten all of that.
- GitHub-flavoured tables — <table> becomes a proper Markdown table with a header row, separator line and aligned columns. A table that only has body rows gets a header row built from the first row, so the output renders on GitHub, GitLab and most static-site generators.
- Fenced code blocks with language detection — <pre> becomes a ``` fenced block, and a class like language-python or lang-js on the code element is carried over as the fence language, so syntax highlighting survives the conversion.
- Nested lists that stay nested — ordered and unordered lists keep their depth with two-space indents, and a list inside a list item is indented under that item instead of being flattened to the top level.
- Two heading styles, two link styles — ATX or Setext headings, inline or reference links. The options cover the two decisions that actually differ between Markdown dialects, without a settings panel nobody reads.
- Private by design — parsing happens entirely in your browser. Your documents never leave your device.
Common Use Cases
- Moving a CMS export into a Markdown repo: Your site's pages live in a CMS that exports HTML, but the new docs site is Markdown files in git. Paste each exported page, convert, and the headings, lists, tables and code samples land as clean Markdown you can commit — instead of hand-rewriting a hundred pages or living with a regex export that flattens every table.
- Turning a rendered help article into a README: A help article exists only as a rendered HTML page, and the project needs it as a README.md. Convert it, keep the reference-style links so the long URLs sit at the bottom, and the result reads like a hand-written README — headings, code blocks and all — in one paste.
- Cleaning up AI-generated HTML into notes: A tool hands you formatted HTML and your notes app wants Markdown. Paste the HTML, convert with ATX headings and inline links, and the result drops straight into Obsidian, Notion's Markdown import or a plain-text notes folder without the angle brackets.
- Teaching the HTML/Markdown mapping: Students grasp the format difference fastest by converting the same content both ways: a heading becomes # or ===, a list becomes - items, a table becomes pipes and dashes. The sample button gives a classroom-ready example in one click, and the conversion note under the output spells out every rule.
- Converting a changelog page: A release-notes page uses <h2> sections, <hr> separators between versions, and <del> for removed features. Convert it and each version becomes an h2, each separator becomes a --- rule, and each removed feature becomes ~~struck through~~ — so the Markdown changelog keeps the same visual cues as the HTML one. A page with 4 version sections, 3 <hr> rules, and 2 <del> items converts to 4 h2 headings, 3 --- lines, and 2 ~~struck~~ lines, ready to commit as CHANGELOG.md.
- Converting API docs with definition lists: API reference pages often define parameters in <dl> blocks: <dt>name</dt> with a <dd> description under it. Convert the page and each parameter becomes a **bold term** with its description indented two spaces underneath — readable in any Markdown viewer without building a table. A page with 12 parameters becomes 12 bold terms with indented descriptions, and the parameter names stay searchable as plain text in the repo.
- Converting a numbered tutorial that continues numbering: A tutorial split across pages sometimes continues numbering with <ol start="5"> on the second page. Convert it and the output starts at 5, 6, 7 — the start attribute is honoured, so the Markdown steps match the HTML steps instead of restarting at 1. Code samples that mention backticks survive too: a step showing `echo `date`` becomes a double-backtick span, and a <pre> block without a <code> child still becomes a plain fenced block with its indentation intact.
HTML to Markdown Converter vs Alternatives
- CodeBeautify HTML to Markdown: The #1 incumbent for this exact conversion, and a clean single-purpose converter. It is a solid tool — but a multi-tool site where the converter shares the page with dozens of other utilities, and its conversion rules are not spelled out on the page. This page documents its rules (nested lists, GFM tables, fenced code with language detection, what is dropped) in the note under the output, so you know exactly what the Markdown will look like before you paste.
- htmlmarkdown.com: A focused converter with a simple paste-and-convert flow — good for a quick one-off when you want zero options. This page adds the choices a real document actually needs: ATX vs Setext headings, inline vs reference links, image handling, file upload, and download as .md, plus a line/word count and an element count so you can see at a glance what converted.
- Turndown (JavaScript library): The reference implementation most converters are built on, and the right choice when you need conversion inside your own app: npm install turndown, add rules, run it in Node or the browser. But it needs code and a project; this page runs the same idea — DOM-tree walking, not regex — for the one-off file on your desk in seconds with no setup.
- Pandoc: The power option for batch conversion: pandoc -f html -t markdown converts whole directories, handles footnotes and citations, and targets a dozen Markdown flavours. But it needs installing and a terminal; this page converts the single document you are looking at right now, in the browser, with the heading and link styles chosen on the page.
- CloudConvert HTML to Markdown: A file-conversion service: upload an .html file and get a .md file back, with batch conversion and format options. It runs on their servers — your document is uploaded — and file conversion is usually metered or account-based. This page converts pasted HTML in your browser with heading and link style choices and no upload, no account, and no per-file limit. Use CloudConvert when you have a folder of files to convert at once; use this page when the document is one paste and privacy matters.
- Firecrawl and URL-to-Markdown tools: Tools like Firecrawl and urltomarkdown.com fetch a live URL and return its content as Markdown — you give them a link, not HTML. That is the right tool when the page is live on the web and you do not have its source. This page is the opposite direction: you already have the HTML (a CMS export, a saved file, an email) and want it as Markdown with heading and link styles you choose. URL tools cannot convert HTML you paste, and this page cannot fetch a URL — pick by which side of the conversion you are holding.
Online converters will convert your HTML if you paste it, Turndown will convert it inside your code, and Pandoc will convert a whole directory from the terminal. For a one-off conversion with documented rules, nested lists and tables that survive, code blocks that keep their language, and zero upload of your data, this page is the fastest private route from HTML to clean Markdown.
Frequently Asked Questions
How do I convert HTML to Markdown online for free?
How are headings converted?
How are links converted?
How are tables converted?
How are code blocks handled?
What happens to images?
Are inline styles and classes preserved?
Is my data uploaded anywhere?
Does strikethrough convert?
How are horizontal rules converted?
Do ordered lists keep their original numbers?
How are definition lists converted?
How are line breaks handled?
What happens to code that contains backticks?
echo `date` becomes `` echo `date` ``, so the inner backtick does not end the code span early. Code without backticks gets the usual single backticks. A <pre> with no <code> child still becomes a fenced block, just with no language on the opening fence — plain ``` on its own lines, indentation preserved exactly.