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. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

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

Convert HTML to clean Markdown or Markdown to HTML as you type, with GitHub tables, code languages kept, style options and a safe preview.

Text processed locallyMore document & textJump to full guide
Related readingHTML Entities and Special Characters: A Complete Reference for Web Developers10 min

Initializing in your browser…

You might also like

Markdown Editor & Preview

Write Markdown with a live side-by-side preview, GitHub tables, task lists and strikethrough, then copy the HTML or download .md and .html files.

Markdown Table Generator

Build Markdown tables in an editable grid or paste them from a spreadsheet or CSV, with column alignment, escaped pipes and neatly padded output.

Image Format Converter

Convert images between PNG, JPEG, WebP, GIF and BMP (and AVIF where your browser supports it), one at a time or in a batch, and compare how big each format makes your picture.

HTML ↔ Markdown Converter: a worked example

A product page is moving from an old CMS to a docs site written in Markdown, and the pricing section has a heading, a link, a table and a highlighted note.

HTML

<h2>Pricing</h2>
<p>Plans start at <strong>$9</strong> a month. <a href="https://example.com/plans">Compare plans</a>.</p>
<table><tr><th>Plan</th><th>Seats</th></tr><tr><td>Starter</td><td>1</td></tr><tr><td>Team</td><td>5</td></tr></table>
<p><mark>New:</mark> annual billing.</p>
What HTML ↔ Markdown Converter produces

Markdown (GitHub flavour)

## Pricing

Plans start at **$9** a month. [Compare plans](https://example.com/plans).

| Plan | Seats |
| --- | --- |
| Starter | 1 |
| Team | 5 |

<mark>New:</mark> annual billing.

The heading, bold text and link map directly to Markdown syntax, and the table becomes a GitHub pipe table because it has a header row and no merged cells. Markdown has no highlight syntax, so with the default policy the <mark> element is kept as inline HTML, which GitHub and most static site generators display; switch the policy to text-only if the destination strips HTML. The counts under the result confirm one heading, one link, one table and one element kept as HTML.

What this converter does

Paste HTML and get clean Markdown as you type, or switch direction and turn Markdown into HTML. Tables become GitHub tables, code keeps its language, and anything Markdown cannot express is kept or flagged instead of silently disappearing.

How it works

Moving content between a website, a CMS and a docs repository usually means converting between HTML and Markdown. Copying the rendered text loses links and structure, and quick regex-based converters break on nested lists, attributes containing > characters or code that contains HTML. This converter reads the HTML into a proper document tree first, the same way a browser does, and writes Markdown from that tree, so nesting and inline formatting come through intact.

HTML to Markdown. Headings, paragraphs, bold and italic, links and images (with titles), ordered and unordered lists at any depth, block quotes, horizontal rules, inline code and code blocks are all converted. A code block's language class, such as class="language-javascript", becomes the info string after the opening fence. Choose GitHub Flavored Markdown to turn tables into pipe tables and <del> into ~~strikethrough~~, CommonMark for strict output without those extensions, or Basic for output with no HTML left in it at all. Elements that Markdown has no syntax for, such as <mark>, <sup> or a table cell that spans columns, follow the policy you choose: keep them as inline HTML (which most Markdown renderers display), keep only their text, or remove them, and the tool tells you what it did.

Style options. Markdown allows several spellings for the same thing, and teams usually have a preference. You can choose # headings or underlined ones, fenced or indented code blocks, the bullet character, asterisks or underscores for emphasis and bold, and inline or reference-style links. Every choice is saved in the share link, so a team can agree on one set and reuse it.

Markdown to HTML. In the other direction, Markdown is rendered with a CommonMark parser with GitHub tables, task lists and strikethrough, producing clean HTML you can paste into a template or CMS. Links whose address could run code (javascript:, vbscript: or HTML data: URLs) are not made clickable and are listed. The swap button sends the result back the other way so you can check a round trip.

Preview and privacy. The Preview view renders the converted Markdown, so you can see exactly what a reader will see. The preview is always generated from Markdown, never from the HTML you pasted, which means scripts or event handlers in pasted HTML cannot run on this page. Nothing is uploaded; conversion happens entirely in your browser.

How to use

  1. 1Choose HTML → Markdown or Markdown → HTML at the top.
  2. 2Paste your content, open an .html or .md file, or press Try an example.
  3. 3For HTML input, pick a flavour: GitHub, CommonMark or Basic. Open Markdown style options to change headings, bullets, emphasis or links.
  4. 4Read the result on the right, or switch to Preview to see it rendered.
  5. 5Copy the result or download it as .md or .html. Use the swap button to convert the result back the other way.

Key features

  • Live conversion in both directions
  • Real HTML parsing, so nested lists, inline formatting and attributes convert correctly
  • GitHub tables and strikethrough, or strict CommonMark, or Basic with no HTML left
  • Code block languages preserved as fence info strings
  • Choice of heading, code block, bullet, emphasis, bold and link styles
  • Elements without Markdown syntax kept as HTML, reduced to text or removed, and reported
  • Markdown to HTML with a CommonMark renderer and unsafe links blocked
  • Safe rendered preview that never executes pasted markup
  • Copy, download and swap direction in one click
  • Runs entirely in your browser

When to reach for this

  • Moving a blog to a static site

    Convert posts exported from WordPress or another CMS into Markdown files for Hugo, Jekyll, Astro or Docusaurus.

  • Writing documentation from a web page

    Turn an existing HTML help page into Markdown for a README or a docs repository, keeping links, code and tables.

  • Publishing Markdown to a CMS

    Write in Markdown, convert to HTML, and paste the clean markup into an editor that only accepts HTML.

  • Cleaning up pasted content

    Strip heavy HTML down to Basic Markdown so only the text structure is left, ready for plain-text systems.

Tips & best practices

  • Copy the page source rather than the rendered text when converting from a website; the source keeps links and structure.
  • Use the swap button after converting HTML to Markdown to render it back and spot anything that changed.
  • Pick underscores for emphasis if your Markdown will be mixed with text that uses asterisks for footnotes or ratings.
  • If a CMS strips HTML, switch to Basic so nothing in the result depends on raw HTML.

Examples

  • A pricing snippet with a table

    A heading, a paragraph with bold and a link, a two-column table and a <mark> highlight convert to ## Pricing, $9, [Compare plans](https://example.com/plans) and a GitHub pipe table. The <mark> element has no Markdown equivalent and is kept as inline HTML.

  • Reference-style links

    With Links set to Reference, every link becomes [text][1] in the text and the addresses are listed at the bottom, which keeps long URLs out of the paragraphs.

  • Strict CommonMark output

    With the CommonMark flavour, <del>old price</del> cannot become ~~strikethrough~~ (that is a GitHub extension), so it follows the policy for unsupported elements instead.

Frequently asked questions

Which Markdown flavour should I choose?

Choose GitHub if the Markdown will be read on GitHub, GitLab, most static site generators or modern editors; it adds tables and strikethrough. Choose CommonMark for strict, portable Markdown. Choose Basic when the destination does not accept any HTML, since it reduces unsupported elements to their text.

What happens to HTML that has no Markdown equivalent?

Elements such as <mark>, <sup>, <details> or cells that span columns are handled by the policy under Markdown style options: keep them as HTML (the default, and most renderers display it), keep only their text, or remove them. The page lists what Markdown could not carry directly.

Are tables converted?

Yes, with the GitHub flavour. Simple tables become pipe tables with a header row. Markdown tables cannot express merged cells or block content inside cells, so such tables are kept as HTML instead of being converted incorrectly.

Does it keep the language of code blocks?

Yes. A class such as language-python or lang-js on the code element becomes the info string after the opening fence, so syntax highlighting keeps working after conversion.

Is it safe to paste HTML from an unknown website?

Yes. The HTML is parsed as data and never inserted into this page. The preview is rendered from the converted Markdown, and links that could run code are not made clickable.

Can I convert a whole HTML page?

Yes. Paste the full page or open the .html file. The <head> section, with its title, meta tags, styles and scripts, is left out, and the content of the body is converted.

Related tools and how they differ

  • Markdown Editor & Preview: A full Markdown editor with a formatting toolbar, outline and HTML export.
  • Markdown Table Generator: Builds and aligns Markdown tables from scratch or from spreadsheet data.

Further reading

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

Private by design

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