html-to-markdown-converter
An HTML-to-Markdown converter parses HTML into a clean, portable Markdown document, preserving semantic structure (headings, paragraphs, lists, links, images, tables, code blocks, blockquotes) while stripping presentational artifacts (inline styles, font tags, class attributes). The ZTools HTML to Markdown tool uses a Turndown-style parser to produce CommonMark-compliant output suitable for GitHub READMEs, blog posts, documentation sites, or any system that consumes Markdown. Bidirectional companion: pair with our Markdown to HTML tool for round trips.
Use casesβ
Migrating blog content from a CMS to a static site generatorβ
Export your old WordPress, Ghost, or Medium posts as HTML; convert each to Markdown, drop the resulting .md files into your Hugo, Jekyll, or Astro content/ folder, and ship. The conversion preserves every heading, link, and image β no rewriting needed.
Cleaning up rich-text-editor output for storageβ
TinyMCE, Quill, and ProseMirror all output HTML laden with <span style="..."> and <font> tags. Convert to Markdown to strip the noise and store a clean, portable representation in your database.
Turning a copy-pasted webpage into shareable textβ
Copy an article from a website, paste the HTML source, get clean Markdown that renders consistently in Slack, Notion, GitHub Issues, or any Markdown-friendly tool.
Producing readme files from documentation HTMLβ
When a tool only generates HTML docs but you need a README.md, convert the relevant section, tweak the output, and commit.
How it worksβ
- Paste HTML into the input pane β Full HTML documents or fragments both work. Drag-drop a
.htmlfile works too. - Click Convert β A Turndown-style parser walks the HTML DOM and produces equivalent Markdown for every supported element.
- Configure options β Heading style (ATX
#vs Setext===), bullet character (-vs*), code-block fence (``` vs indent), bold style (**vs__). - Review the output β Side-by-side preview shows the rendered Markdown to confirm visual fidelity.
- Copy or download β Save as
.mdor paste into your CMS, README, or chat tool.
Examplesβ
Input: <h1>Hello</h1><p>This is <strong>bold</strong> text.</p>
Output: # Hello
This is bold text.
Input: <ul><li>One</li><li>Two</li></ul>
Output: - One
- Two
Frequently asked questionsβ
Does the converter preserve every HTML feature?
Markdown does not have native equivalents for every HTML feature (e.g., colspan, complex CSS). Unsupported features are either dropped or kept as inline HTML (Markdown allows raw HTML). The tool keeps inline HTML for the safest round-trip.
How are images handled?
Images become standard Markdown image syntax: \![alt\]\(src). Width/height attributes are dropped because Markdown does not support them β wrap in HTML if you need them preserved.
What happens to inline styles and classes?
Stripped by default. Markdown is intentionally style-agnostic. If you need to preserve them, the tool provides an "Allow inline HTML" option to keep <span class="..."> blocks intact.
Are tables supported?
Yes β converted to GitHub-flavored Markdown table syntax. Complex tables (nested headers, colspan) may not round-trip perfectly; check the preview.
Will my HTML be uploaded?
No. Conversion runs entirely in your browser. Disconnect from the internet after page load and the tool still works.
How do I round-trip Markdown β HTML β Markdown?
Paste Markdown into our Markdown to HTML tool, copy the HTML output, paste into this tool. Round-trip is mostly lossless except for very complex inline HTML or unusual whitespace.
Tipsβ
- For migrating an entire site, batch the conversion via the Turndown library in a Node script β this tool is for ad-hoc one-shot use.
- Always preview the Markdown output to spot dropped features before committing.
- Use the "Allow inline HTML" option if your source contains custom embeds (iframes, video, etc.).
- Pair with a linter (
markdownlint) on the output to catch formatting issues.
Try it nowβ
The full html-to-markdown-converter runs in your browser at https://ztools.zaions.com/html-to-markdown-converter β no signup, no upload, no data leaves your device.
Last updated: 2026-05-05 Β· Author: Ahsan Mahmood Β· Edit this page on GitHub