/
367
Sponsor
All tools

HTML to Markdown Converter

Paste HTML on the left and copy clean Markdown on the right. Useful for moving content out of a CMS, cleaning up rich text, or saving editor output as .md files.

FreeNo sign-upRuns in your browser

How to convert HTML to Markdown

  1. 1Paste your HTML into the input panel, or upload a file.
  2. 2The Markdown output updates as you type.
  3. 3Open the Preview tab to check how the content renders.
  4. 4Copy the result with the copy button.

What gets converted

  • Headings h1 to h6 become # to ###### headings.
  • strong and b become **bold**, em and i become *italic*, s and del become ~~strikethrough~~.
  • Links become [text](url) and images become ![alt](src).
  • Bulleted and numbered lists become - and 1. lists, and nested lists keep their indentation.
  • Tiptap task lists become GitHub task lists: - [ ] and - [x].
  • Tables become GitHub-flavored Markdown pipe tables.
  • pre and code become fenced code blocks, blockquote becomes >, and hr becomes ---.

Why convert HTML to Markdown?

Markdown is smaller and easier to read than HTML. It diffs cleanly in git, works in README files and static site generators like Astro, Hugo, and Next.js with MDX, and uses fewer tokens when you pass content to an LLM.

It is also a common export format. If your app stores rich text as HTML, offering a Markdown download lets people move their content into note apps, docs tools, and code repositories.

Cleaning up messy HTML

HTML copied from Google Docs, Word, or a CMS is full of span tags, classes, and inline styles. This converter parses your HTML through a Tiptap schema first, so anything without meaning is dropped and only the text and its structure are kept.

Text color, alignment, and font settings have no Markdown syntax, so they are removed. GitHub-flavored Markdown tables also can't express merged cells, so keep tables simple if you need a clean round trip.

Convert HTML to Markdown in your own code

This tool is a headless Tiptap editor, so the same conversion takes a few lines in your app. See the Markdown extension docs for details.

convert.ts
import { Editor } from "@tiptap/core";
import { StarterKit } from "@tiptap/starter-kit";
import { Markdown } from "@tiptap/markdown";

const editor = new Editor({
  element: null,
  extensions: [StarterKit, Markdown],
});

editor.commands.setContent(html);
const markdown = editor.getMarkdown();

Frequently asked questions

Is my HTML uploaded anywhere?

No. The conversion runs entirely in your browser with Tiptap, so your HTML never leaves your device.

Which HTML elements are supported?

Headings, paragraphs, bold, italic, strikethrough, inline code, links, images, lists, task lists, blockquotes, code blocks, horizontal rules, and tables.

What happens to unsupported tags?

Tags with no Markdown equivalent, such as div, span, or inline styles, are reduced to their text content so the output stays clean.