# HTML to Markdown Converter - Rich Text to MD and MD to HTML

> Convert HTML to Markdown and back: headings, nested lists, task lists, GFM tables, code blocks, links and images. Paste rich text from web pages or Docs.

- URL: https://qilingtools.com/en/html-markdown
- Category: Developer Tools (https://qilingtools.com/en/dev)
- Tags: [Markdown](https://qilingtools.com/en/tags/markdown), [Converters](https://qilingtools.com/en/tags/convert), [Developer](https://qilingtools.com/en/tags/dev)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

Moving a web article, an online doc or an old blog post into Markdown notes, a GitHub README or a static site? Paste the HTML source — or simply copy a selection from a web page, Google Docs or Word and paste it here: the tool reads the rich-text HTML from the clipboard instead of the plain text that loses formatting. The converter parses with the browser’s DOMParser and walks the tree to produce GitHub-flavored Markdown: H1–H6 headings, deeply nested ordered and unordered lists, task-list checkboxes, tables with column alignment (merged cells padded), fenced code blocks with the language taken from the class (the fence grows automatically to avoid clashes), inline code, links and images with titles, nested blockquotes, bold, italic, strikethrough, line breaks and horizontal rules. It also understands the span styles Google Docs uses for bold, italic and strikethrough, and escapes characters that would otherwise be read as Markdown syntax. Options cover heading style (ATX # or Setext underline), bullet marker, code fence, link style (inline or reference), emphasis markers and line-break style. The other direction renders Markdown to HTML with marked, with GFM and single-newline breaks optional. Both sides can be previewed, copied and downloaded as .md or .html, all locally.

## How to use

1. Choose a direction and paste HTML or Markdown — or copy rich text from a page and paste it, or click “Paste rich text from clipboard”
2. Adjust heading, list, code block and link styles below
3. View the source or preview on the right, then copy or download .md / .html

## Features

- HTML → Markdown (GFM) via a DOMParser walk
- Nested lists, task lists and GFM tables with alignment
- Code blocks with detected language and a safe fence
- Rich-text paste from web pages, Google Docs and Word
- ATX / Setext headings, bullet marker, inline or reference links and more
- Markdown → HTML (marked, GFM and line breaks optional)
- Safe preview (no scripts), copy and download
- Open .html / .md files

## FAQ

### How do I turn part of a web page into Markdown?

Select it on the page, press Ctrl/⌘+C, then click into the input box here and press Ctrl/⌘+V — the HTML flavor of the clipboard is picked up and converted immediately. You can also click “Paste rich text from clipboard” (the browser will ask for clipboard permission). It works the same for Google Docs and Word, keeping bold, italic, lists, tables and links.

### Are there limits when converting tables?

A GFM table needs a header row and single-line cells, so an empty header row is added when the first row isn’t a header, line breaks inside cells become <br>, and colspan is padded with empty cells (rowspan can’t be represented). A | inside a cell is escaped as \|. Complex nested tables are best left as HTML.

### Why do some characters get a backslash in front?

Characters such as *, _, [, ], ` and a leading # or “1.” have special meaning in Markdown; left alone they could turn into bold text, headings or lists. The converter only escapes when needed — an underscore inside a word like snake_case is left as is — so the rendered output looks like the original HTML.

### Can I convert back and forth?

Yes. When you switch direction, the current output becomes the new input so you can check the round trip. For headings, lists, tables, code blocks and links, HTML → Markdown → HTML gives an equivalent result, but anything Markdown can’t express — classes, styles, custom attributes — is lost, and layout-only tags such as div and span are dropped.

## Related tools

- [JSON Formatter](https://qilingtools.com/en/json): Free online JSON formatter: beautify or minify, validate with the exact line and column of any error, browse a collapsible tree, sort keys and escape strings.
- [Base64 Encode/Decode](https://qilingtools.com/en/base64): Free online Base64 encoder and decoder: UTF-8 safe, optional URL-safe variant, convert text to Base64 and back in real time. Processed locally, never uploaded.
- [URL Encode/Decode](https://qilingtools.com/en/url-encode): Free online URL encoder and decoder with encodeURIComponent and encodeURI modes. Escapes Chinese, spaces and special characters. Real-time and local, no upload.
- [JWT Decoder](https://qilingtools.com/en/jwt): Free online JWT decoder: decode the header and payload of a JSON Web Token, show expiry and issued-at times, all locally without uploading the token.
- [Timestamp Converter](https://qilingtools.com/en/timestamp): Free online Unix timestamp converter: convert timestamps and dates, auto-detect seconds or milliseconds, and show local, UTC, ISO 8601 and relative time.
- [Hash / Checksum](https://qilingtools.com/en/hash): Free online hash calculator: SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file through the browser crypto API. Files never leave your device.
- [UUID Generator](https://qilingtools.com/en/uuid): Free online UUID generator: create RFC 4122 UUID v4 in bulk with a cryptographic RNG. Options for uppercase, no hyphens and braces, with one-click copy.
- [Base Converter](https://qilingtools.com/en/base-convert): Free online number base converter: convert between binary, octal, decimal, hexadecimal and any base 2–36. Uses BigInt for huge integers, computed locally.
