Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. All processing happens entirely in your browser - your files never leave your device. No uploads, no accounts, complete privacy.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. Document & Text
  3. HTML ↔ Markdown Converter
Add to favorites

HTML ↔ Markdown Converter

Bidirectional HTML and Markdown converter with GitHub Flavored Markdown, tables, live preview, and customizable output styles

Convert HTML content into clean Markdown with a single paste. The converter handles headings, paragraphs, links, images, lists, tables, and code blocks, producing Markdown that is easy to read and edit. Ideal for migrating web content to Markdown-based platforms.

Text processed locallyMore document & textJump to full guide

Related reading

  • HTML Entities and Special Characters: A Complete Reference for Web Developers14 min read

Initializing in your browser…

You might also like

Markdown Editor & Preview

Full-featured Markdown editor with live preview, GitHub Flavored Markdown, syntax highlighting, table of contents, export to HTML/PDF, and multiple themes

Markdown Table Generator

Create Markdown tables with a visual editor. Add columns, rows, set alignment, and export perfectly formatted tables.

Image Format Converter

Convert images between PNG, JPG, WebP, AVIF, BMP formats. Features quality control, transparency support, and batch conversion for efficient workflow.

HTML ↔ Markdown Converter: a worked example

You are migrating blog posts out of a CMS and need the article HTML as clean Markdown for a static-site repo.

HTML

<h2>Intro</h2><p>See <a href="/docs">the docs</a>.</p>
HTML ↔ Markdown Converter produces

Markdown

## Intro

See [the docs](/docs).

Block and inline elements are mapped to their Markdown equivalents, headings, links, lists, emphasis, code, while presentational wrappers are dropped, producing source you can actually maintain in version control. It also converts Markdown back to HTML, so it doubles as a round-trip checker during a migration.

What this converter does

Convert HTML content into clean Markdown with a single paste. The converter handles headings, paragraphs, links, images, lists, tables, and code blocks, producing Markdown that is easy to read and edit. Ideal for migrating web content to Markdown-based platforms.

How it works

This is a bidirectional converter (mode toggle 'HTML to MD' / 'MD to HTML', plus a Swap button that flips direction and exchanges the two panes) built entirely on regular-expression find-and-replace rather than a parser library like Turndown or marked. On the HTML-to-Markdown side it walks the source through ordered regex passes: h1-h6 become headings, <strong>/<b> become your chosen strong delimiter and <em>/<i> the emphasis delimiter, <pre><code> becomes a code block, <a>/<img> become link/image syntax, <ul>/<ol>/<blockquote>/<hr>/<p>/<br> get their Markdown equivalents, every remaining tag is then stripped, and a fixed set of HTML entities (&nbsp;, &lt;, &gt;, &amp;, &quot;, &#39;, &copy;, &reg;, &trade;) is decoded. The three 'flavors' in the dropdown are narrow: GFM, CommonMark, and Basic produce identical output except that strikethrough (<del>/<s> to ~~text~~) and table conversion are gated behind GFM only, so selecting CommonMark or Basic simply drops those two features.

The Options panel (HTML-to-Markdown only) exposes real, code-backed switches. Heading style toggles ATX (# Title) versus Setext, but Setext is applied only to h1 and h2 (rendered as = and - underlines sized to the text length); h3-h6 always fall back to ATX hashes because Setext has no equivalent for deeper levels. Code block style switches between fenced ``` blocks (which preserve a language hint pulled from a class="language-xxx" attribute) and four-space indented blocks (which cannot carry a language). You can also pick the bullet marker (-, *, or +), the emphasis delimiter (* vs _), the strong delimiter (** vs __), and toggle Preserve links, Preserve images, Convert tables, and Strip HTML comments. A swappable detail worth knowing: choosing _ for emphasis can break inside words because intra-word underscores are not emphasis in many parsers, whereas asterisks are.

Because the conversion is regex-based and semantic-only, several HTML constructs are intentionally lossy and the output reflects that. Wrapper elements (div, span, article, section, main, header, footer, nav, aside, figure, figcaption) are stripped to nothing, so layout and styling structure disappears while their inner text survives; class, id, and inline style attributes are never carried over. Tables are flattened by extracting <th>/<td> text and joining cells with pipes, so colspan/rowspan and cell-level formatting collapse, and ordered lists nested inside unordered ones can renumber. The reverse direction (Markdown-to-HTML) escapes &, <, and > first, then rebuilds tags, but it does not sanitize, and the Live Preview renders that HTML directly via dangerouslySetInnerHTML. After HTML-to-Markdown runs, the panel shows live counts of headers, paragraphs, links, lists, and tables detected, and collapses any run of three-plus blank lines down to one. Everything runs locally in the browser, and you can upload .html/.htm/.md/.markdown/.txt files or download the result as a .md or .html file.

How to use

  1. 1Paste HTML source code into the input area
  2. 2View the converted Markdown output instantly
  3. 3Adjust conversion options if available (e.g., heading style, link format)
  4. 4Copy the Markdown result

Key features

  • Converts headings, lists, links, images, and tables
  • Preserves code blocks and inline code
  • Handles nested HTML structures
  • Clean output without unnecessary blank lines
  • One-click copy to clipboard

When to reach for this

  • Migrating blog content

    Convert existing HTML blog posts into Markdown when moving to a static site generator like Hugo, Jekyll, or Astro.

  • Creating documentation from web pages

    Pull content from HTML pages and convert it to Markdown for use in wikis, README files, or documentation sites.

  • Simplifying rich text

    Strip away complex HTML formatting and produce plain Markdown that is easier to maintain and version-control.

Tips & best practices

  • Selecting CommonMark or Basic instead of GFM doesn't change formatting style, it only disables strikethrough and table conversion. Keep GFM unless your target parser rejects those.
  • Setext heading style only underlines h1 and h2; h3 through h6 silently revert to # ATX headings, so use ATX if your document has deep heading levels.
  • If your HTML relies on <div>/<span> wrappers, class names, or inline styles, expect them to vanish entirely; only the text content and semantic tags survive.
  • For code blocks, the language label is only kept when the source has a class="language-xxx" on the <code> tag and you use the fenced (```) style; indented blocks drop the language.

Examples

  • Convert an article with a GFM table

    Load the 'With Table' sample (or paste your own), keep flavor on GFM and 'Convert tables' checked, then Convert. The <table> is flattened into a pipe-delimited Markdown table with a --- separator row; switching to CommonMark or Basic would drop the table entirely.

  • Round-trip and preview Markdown

    Paste Markdown, switch to MD to HTML (or load the 'Markdown' sample), Convert, then toggle Preview to render the generated HTML live. Note the output is not sanitized, so only preview content you trust.

Frequently asked questions

Does it handle inline CSS styles?

Inline styles are stripped since Markdown does not support CSS. The converter preserves semantic meaning (bold, italic, headings) but not visual styling.

What about HTML tables?

Tables are converted to Markdown table syntax with pipes and dashes. Complex tables with colspan/rowspan may not convert perfectly.

Can it convert an entire web page?

Paste the HTML source and it will convert the body content. Navigation menus, scripts, and style blocks are ignored or stripped.

Related tools and how they differ

  • Markdown Editor & Preview: Live Markdown editor with split preview, GFM tables, task lists, and .md/.html export; use it to write and render whole documents, not convert HTML.
  • Markdown Table Generator: Generates a single GFM table via a grid editor with alignment markers and pipe escaping; use it when you just need clean table syntax.
  • Code Syntax Highlighter: Renders syntax-colored snippets in 7 themes and exports HTML or PNG; use it for sharable code images, not HTML-to-Markdown conversion.

Further reading

  • HTML Entities and Special Characters: A Complete Reference for Web Developers14 min read

Private by design

Your text is processed locally in the browser. Nothing you paste or open is transmitted or logged.