ToolNest logoToolNest.

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 ![alt](src); <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.

🔒 100% Private: Data never leaves your device.

✓ Free forever  ·  ✓ No signup  ·  ✓ Tool inputs stay in your browser — never sent to our servers.

Try next: Markdown to HTML · Markdown to Email HTML Converter · HTML Encoder / Decoder

How to Use the HTML to Markdown Converter

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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?

Common Use Cases

HTML to Markdown Converter vs Alternatives

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?
Paste your HTML into the box above (or upload the .html file), pick your heading and link styles, and press Convert to Markdown. The output appears instantly — headings, lists, tables, code blocks, links and images converted — then copy it or download the .md file. No signup, no install, no upload.
How are headings converted?
h1 to h6 become # to ###### in ATX mode, which is the default. In Setext mode, h1 becomes a line followed by === and h2 becomes a line followed by ---, matching the original Markdown style; h3 to h6 stay ATX either way, because Setext only defines two levels. Heading text keeps its inline formatting, so a bold word inside a heading stays bold.
How are links converted?
Inline mode gives [text](url) — the link sits in the sentence. Reference mode gives [text][1] in the sentence with a [1]: url definition appended at the end of the document, one definition per unique URL. Links with no href become plain text, and a link whose text is the URL itself becomes the bare URL in angle brackets, like <https://example.com>.
How are tables converted?
A table becomes a GitHub-style Markdown table: the header row (from <th>, or the first row when there is no header) is followed by a | --- | --- | separator, then one row per <tr>. Cell text keeps its inline formatting. Tables nested inside table cells are a real Markdown limitation — they flatten to plain text, and the page says so instead of producing a broken table.
How are code blocks handled?
Inline <code> becomes `code`, and <pre> becomes a fenced block with ``` on its own lines. If the code element carries a class like language-python, lang-js or data-lang, the language name is carried onto the opening fence, so syntax highlighting works on GitHub and in your editor. Indentation inside the block is preserved exactly.
What happens to images?
An image becomes ![alt text](src) when the 'Convert images' box is ticked, which is the default. The alt attribute becomes the bracket text, so a screen reader and a broken-image fallback both still describe the picture. Untick the box and images are skipped entirely — useful when the Markdown will live somewhere the image URLs cannot resolve anyway.
Are inline styles and classes preserved?
No — Markdown has no syntax for class names, inline styles, ids or data attributes, so they are dropped. That is the honest trade of the format: structure survives, presentation does not. If the styling matters, keep the HTML; if the content matters, Markdown is the right destination. Script and style elements are skipped entirely.
Is my data uploaded anywhere?
No. The entire conversion runs in JavaScript in your browser — the HTML never touches a server. Safe for internal docs, draft pages, CMS exports and anything else you would not paste into a stranger's upload form.
Does strikethrough convert?
Yes — <s>, <del> and <strike> all become ~~text~~, the GitHub-flavoured strikethrough syntax. A changelog line like <del>v1 API</del> becomes ~~v1 API~~, and a crossed-out price in a product page keeps its meaning in the Markdown. Plain Markdown renderers that do not support GFM may show the tildes literally, so check your target — GitHub, GitLab, and most static-site generators render it correctly.
How are horizontal rules converted?
An <hr> becomes --- on its own line, with a blank line before and after it. Three <hr> elements in a changelog become three --- rules, one between each version section. A line of --- is also valid Markdown for a Setext h2 underline, so a rule that directly follows a line of text can be misread as a heading underline — the converter puts a blank line between them, which keeps the rule a rule.
Do ordered lists keep their original numbers?
No — the converter renumbers from 1, or from the list's start attribute when one is set. A list written as 3, 4, 5 in the HTML becomes 1, 2, 3 in the Markdown, because Markdown renderers number ordered lists themselves and the source numbers are usually wrong after editing anyway. Set start="5" on the <ol> and the output is 5, 6, 7. Nested ordered lists renumber independently at each level, so a sub-list always starts at 1 (or its own start value).
How are definition lists converted?
A <dt> becomes a bold term and a <dd> becomes its definition indented two spaces: **Term** on one line, then two spaces and the definition on the next. There is no definition-list syntax in standard Markdown, so this is the closest readable rendering — GitHub shows it as a bold line followed by an indented paragraph. A <dl> with 12 parameters becomes 12 bold terms with their descriptions underneath, and the parameter names stay searchable as plain text.
How are line breaks handled?
A <br> becomes two trailing spaces followed by a newline — the Markdown hard break. A poem or address with three <br> lines becomes three lines with two trailing spaces each, so the line breaks survive in the rendered Markdown. The two spaces are invisible in most editors, so if your output looks like one long line, check for trailing spaces first — some formatters strip them on save. Paragraph breaks (<p>) become blank lines instead, which is the normal Markdown paragraph separation.
What happens to code that contains backticks?
Inline <code> that contains a backtick is wrapped in double backticks with spaces around it: 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.