🏆 US-Registered Digital Marketing Agency Trusted by 200+ brands · USA · UK · Canada · AUS
DEVELOPER TOOL

HTML to Markdown Converter — clean, copyable output

Paste in raw HTML and instantly get clean, readable Markdown — headings, links, lists, code blocks, and more.

Markdown output
 
 
0
Elements converted
0
Elements stripped
0
Words out
0
Lines out
Tip: unsupported tags (like <table> or <iframe>) have their inner text kept but the tag itself is stripped, so nothing is silently lost.
Advertisement

The HTML to Markdown converter on this page takes raw HTML — copied from a web page, exported from a CMS, or pasted from a rich-text editor — and turns it into clean Markdown you can drop straight into a README, a static-site blog post, a GitHub issue, or a Notion doc.

We built it because Arb Digital moves content between systems constantly — client CMS exports, documentation rewrites, blog migrations — and hand-converting HTML to Markdown by search-and-replace is slow and error-prone the moment nested lists or code blocks are involved.

What This HTML to Markdown Converter Does

Paste any HTML snippet into the input box and the converter walks the markup structurally — not with a blunt regex pass — mapping each recognized tag to its Markdown equivalent: headings become # through ######, <strong>/<b> become **bold**, <em>/<i> become *italic*, links become [text](url), images become ![alt](src), ordered and unordered lists (including nested lists) get correctly indented, blockquotes get a leading > on each line, and code becomes inline backticks or a fenced ``` block depending on whether it was inline <code> or a <pre> block. Anything the converter doesn't recognize is stripped down to its plain text so you never lose content — you just lose formatting it can't represent.

How to Use the HTML to Markdown Converter

  1. Copy your HTML from wherever it lives — browser dev tools, a CMS export, an email, or a rich text editor's "view source" option.
  2. Paste it into the input box on the left, replacing the example markup.
  3. Click "Convert to Markdown." The converter parses the structure and builds the Markdown output instantly.
  4. Review the output in the right-hand box — check that nested lists, links, and code blocks look right.
  5. Click "Copy Markdown" to copy the result to your clipboard.
  6. Paste it into your README, static site generator, CMS, or documentation tool of choice.

The Supported HTML Subset

This tool intentionally supports the tags that make up the overwhelming majority of real-world content markup rather than attempting a full, lossless HTML-to-Markdown round trip (which isn't fully possible anyway, since Markdown is a smaller language than HTML). Supported elements include: headings h1h6, paragraphs, strong/b, em/i, links (a), images (img), ordered lists (ol), unordered lists (ul), nested lists at any depth, blockquotes (blockquote), inline code (code), fenced code blocks (pre), and horizontal rules (hr). Line breaks (br) are converted to a Markdown hard line break. This mirrors the practical subset described in the specification maintained by the original Markdown syntax documentation by John Gruber, which remains the de facto reference most Markdown renderers (GitHub, static site generators, note apps) build on.

Advertisement

What Gets Stripped, and Why That's Honest Behavior

Markdown has no native representation for some HTML constructs — data tables with colspans, embedded iframes, forms, custom web components, inline styling attributes, and complex nested layout div soup. Rather than pretending to convert these into something Markdown was never designed to hold, this tool strips the wrapping tag and keeps the readable text content inside it, so you don't silently lose information — you just lose the specific visual structure that Markdown can't express. This is the same honest trade-off every serious HTML-to-Markdown library makes; a converter that claims 100% fidelity for every possible HTML tag is usually hiding lossy behavior somewhere rather than avoiding it.

Common Places You'll Use an HTML to Markdown Converter

  • Migrating a blog from a CMS to a static site generator like Jekyll, Hugo, Astro, or Eleventy, all of which expect Markdown content files.
  • Writing GitHub README files from content you first drafted or copied as HTML.
  • Pasting documentation into Notion, Obsidian, or another Markdown-native note tool without manually retyping formatting.
  • Cleaning up content copied from Word or Google Docs (which export bloated HTML) before it goes into a chat message, ticket, or wiki page that renders Markdown.
  • Preparing training or reference text for AI tools that read Markdown more reliably than raw HTML with inline styling noise.

Cleaning Up "Bloated" HTML Before You Convert

Content pasted from Word, Google Docs, or Outlook is notorious for producing enormous, deeply nested HTML full of empty <span> wrappers, inline style attributes for every font tweak, and Microsoft-specific conditional comments that have no meaning outside a Word document. This converter's structural walk handles that gracefully by descending into unrecognized wrapper tags and pulling out only the text and genuinely meaningful child elements — so a paragraph buried under four layers of styling <span> tags still comes out as a clean paragraph, not four layers of Markdown noise. If your output still looks messier than expected, the usual cause is content that used visual formatting tricks instead of semantic tags in the first place — for instance, a "heading" that was actually just larger, bolded regular text rather than an <h2> element, which this tool (like any converter) has no reliable way to detect automatically since the underlying HTML gives no structural signal that it was meant to be a heading.

Round-Tripping: Converting Markdown Back to HTML

Content work is rarely one-directional — you might convert a page to Markdown to edit it more comfortably in a plain-text editor, then need to convert it back to HTML to publish it on a platform that only accepts markup. Because Markdown is intentionally a smaller, simpler language than HTML, a clean round trip (HTML → Markdown → HTML) generally preserves everything this converter supports — headings, emphasis, links, images, lists, blockquotes, and code — but anything that was stripped on the way to Markdown (custom classes, inline styles, tables, embeds) obviously won't reappear on the way back, since that information was never captured in the first place. If your workflow depends on a lossless round trip for those richer elements, it's worth keeping the original HTML source alongside the Markdown copy rather than treating the conversion as fully reversible.

Nested Lists and Why They're Tricky

Nested lists are the single most common place a naive HTML-to-Markdown conversion breaks, because Markdown represents nesting purely through indentation rather than explicit opening and closing tags. This converter tracks list depth as it walks the HTML tree, so a <ul> inside an <li> gets indented by four spaces per nesting level in the Markdown output, and ordered lists keep their numbering correct even inside a nested unordered list, or vice versa. If your output looks flat when you expected nesting, double-check that your source HTML actually nests the inner list inside the parent <li> rather than as a sibling — that's a common authoring mistake in hand-written or CMS-exported HTML, and no converter can recover structure the original markup never had.

Fenced Code Blocks vs Inline Code — Getting the Distinction Right

Markdown has two very different ways to represent code, and picking the right one matters for readability. Inline code — a variable name, a short snippet, a file path mentioned mid-sentence — becomes a single word wrapped in backticks, like const, and reads naturally inside a normal paragraph. A multi-line snippet, on the other hand, needs to be its own fenced block set off with triple backticks, so line breaks, indentation, and spacing are preserved exactly. This converter distinguishes the two by checking whether a <code> tag is sitting directly inside a <pre> tag (multi-line, gets fenced) or standing alone inside a paragraph (inline, gets single backticks) — the same distinction most CMS platforms and rich-text editors use internally when they export HTML in the first place. If your source HTML wraps a whole multi-line snippet in a bare <code> tag without a surrounding <pre>, the browser will have already collapsed its whitespace before this tool ever sees it — so for best results, always wrap block-level code in both tags together, exactly as well-formed HTML should.

Why a Structural Parser Beats a Regex-Based Converter

A number of quick "HTML to Markdown" scripts floating around the web work by chaining together regular expressions — replace every <strong> with **, every <a href="..."></a> with a bracket-paren pattern, and so on. That approach breaks the moment tags are nested, attributes appear in an unexpected order, or whitespace is formatted differently than the regex author assumed. This tool instead parses your HTML into an actual DOM tree using the browser's built-in DOMParser, then walks that tree node by node the same way a browser itself understands the document's structure. That's why nested lists, links containing bold text, and blockquotes containing multiple paragraphs all convert correctly here — the tool understands parent/child relationships, not just surface-level text patterns.

Migrating a whole site's content, not just one page?

Arb Digital handles full CMS migrations, content cleanup, and rebuilds for growing businesses. Check out our web design services or keep browsing our free developer tools below.

Our Web Design Services All Free Tools

Common Mistakes to Avoid

  • Pasting an entire HTML document instead of a fragment. Only the visible body content converts meaningfully — a full <html><head></head><body> wrapper adds noise the converter has to strip.
  • Expecting tables to convert perfectly. Markdown table syntax is limited (no colspans, no nested tables) — complex tables are better kept as HTML inside Markdown, which most renderers still allow.
  • Not checking link and image paths. Relative URLs (like /images/photo.jpg) copy through as-is; if you're moving the content to a new domain, you'll still need to update those paths.
  • Losing inline styling on purpose without realizing it. Font colors, custom CSS classes, and inline style attributes have no Markdown equivalent and are correctly dropped — if you need that formatting preserved, Markdown isn't the right target format.
  • Forgetting to re-check code block language hints. This converter outputs a plain fenced code block; if your source used a class="language-js" hint, add the language tag manually after conversion for syntax highlighting on platforms like GitHub.

Related Free Tools From Arb Digital

Going the other direction? Try our Markdown to HTML Converter. If you're cleaning up the CSS around your converted content, check out the CSS Minifier, the CSS Clamp Generator, and the CSS Specificity Calculator. For layout work, see the CSS Grid Generator. Browse everything in our free online tools hub.

Frequently Asked Questions

Does this tool send my HTML to a server?

No. All parsing and conversion happens locally in your browser using JavaScript — nothing you paste is uploaded or stored anywhere.

Which HTML tags does it support?

Headings (h1-h6), paragraphs, bold/italic, links, images, ordered and unordered lists (including nesting), blockquotes, inline code, fenced code blocks, and horizontal rules. Unsupported tags are stripped but their inner text is kept.

Can it convert HTML tables to Markdown tables?

Not currently - Markdown's table syntax is limited (no colspans or nested content), so this tool focuses on the content types that translate cleanly rather than approximating tables imperfectly.

Will it preserve inline CSS styling?

No, and this is intentional. Markdown has no mechanism for inline styles, custom colors, or CSS classes, so those are dropped while the actual text content is preserved.

Does it handle nested lists correctly?

Yes. The converter tracks list depth as it walks the HTML structure and indents nested list items accordingly, keeping ordered and unordered numbering/bullets correct at each level.

What happens to line breaks and empty tags?

Line break tags convert to a Markdown hard line break, and empty or whitespace-only elements are skipped so your output doesn't fill up with blank Markdown lines.

This tool runs entirely in your browser — no HTML you paste is sent to any server.

Advertisement

👋 Hey! Want to grow your business? Ask me anything — a free marketing proposal is on the table!