HTML to Markdown
convert HTML to clean Markdown format
Interactive HTML to Markdown — coming soon
In development. We're still building the interactive HTML to Markdown. The guide below explains exactly what it does and how to use it. In the meantime, here are DevLab tools that already work in your browser:
Browse all working tools →Paste raw HTML and get back clean Markdown in one step. A <h2> tag containing a nested <code> element comes out as ## Heading with inline backtick code preserved, making it immediately usable in a Hugo post or a GitHub README. Tables convert to GFM pipe syntax, which is the key difference from plain text extraction tools that lose table structure entirely.
What is HTML to Markdown?
The converter walks an HTML string element by element, mapping each tag to its Markdown equivalent. Headings become ATX-style hash prefixes, anchor tags become [text](url), and <code> inside a <pre> becomes a fenced code block with triple backticks. Pasting a raw blog post scraped from a CMS returns structured Markdown paragraphs with the heading hierarchy intact and all style attributes dropped.
For one-off conversions, this beats installing Pandoc or setting up Python just to run html2text. Pandoc is the right choice when batch-converting files, needing footnote or definition-list support, or wanting output-flavor control via flags like --to=gfm or --wrap. html2text handles bulk pipeline work well. This tool covers the common case: an HTML snippet that needs to become readable Markdown without any local tooling.
The main gotcha is tables. HTML <table> elements convert to GFM pipe tables, which render correctly on GitHub, GitLab, and most static site generators, but strict CommonMark has no table syntax at all. If your target renderer enforces CommonMark-only, those pipe characters appear as literal text. Separately, <div> wrappers with no semantic role generate extra blank lines, producing stray paragraph breaks once the Markdown is rendered.
When to use HTML to Markdown
- Copy a live webpage's article HTML via DevTools and convert it to Markdown for a Hugo or Jekyll content directory.
- Extract readable post bodies from a CMS database export where content columns store raw HTML strings.
- Migrate an HTML email newsletter to plain Markdown prose before importing it into a Notion page or GitHub issue.
Frequently Asked Questions
Why do `<div>` wrappers produce extra blank lines in the Markdown output?
Do the converted tables work in all Markdown renderers, or only some?
What happens to `<span>` tags and inline `style` attributes during conversion?
How does this compare to running `pandoc -f html -t gfm` locally?
Will deeply nested lists like `<ul>` inside `<li>` convert with correct indentation?
Related Tools
- HTML Beautifierformat and indent HTML code with configurable settings · HTML
- HTML Minifierminify HTML by removing whitespace and comments · HTML
- Markdown Previewerpreview Markdown with live side-by-side rendering · Text
- Text Diff Checkerfind differences between two text blocks with color-coded highlighting · Text