HTML sang Markdown

Chuyển đổi HTML thành cú pháp Markdown sạch.
HTML
MARKDOWN

Live Conversion

See Markdown output update instantly as you type HTML.

Full Syntax

Headings, bold, italic, links, images, tables, code blocks and more.

Export Markdown

Copy or download the generated .md file.

Client-side

All processing in your browser. No data uploaded.

Giới thiệu về HTML sang Markdown

HTML to Markdown conversion is a common task for developers and writers who want to migrate content from a CMS or website into a Markdown-based workflow — such as GitHub repositories, static site generators (Hugo, Jekyll, Gatsby), note-taking apps (Obsidian, Notion, Bear), or documentation platforms. This tool converts HTML tags into their Markdown equivalents entirely in your browser, with no server upload required. It handles all standard HTML elements: headings (h1–h6), paragraphs, bold, italic, strikethrough, inline code, fenced code blocks with language detection, links, images, unordered and ordered lists, blockquotes, horizontal rules, and GitHub Flavored Markdown tables. Conversion happens instantly as you type — paste your HTML on the left and the clean Markdown appears on the right. You can copy the output to your clipboard or download it as a .md file.

Làm sao để HTML sang Markdown?

  1. Paste your HTML source code into the left input panel, or click "Load Sample" to see an example conversion.
  2. The Markdown output appears instantly on the right as you type or edit.
  3. Review the output — check that headings, lists, links, and tables converted correctly.
  4. Click "Copy" to copy the Markdown to your clipboard, then paste it into your Markdown editor or repository.
  5. Alternatively, click "Download" to save the output as a .md file directly to your device.
  6. For code blocks, make sure your HTML uses <pre><code class="language-js"> tags — the language class is automatically detected.

Câu hỏi thường gặp

What HTML elements does this converter support?

It supports all common HTML elements: headings (h1–h6), paragraphs, bold (strong/b), italic (em/i), strikethrough (del/s), inline code, fenced code blocks (pre + code), links, images, unordered lists (ul/li), ordered lists (ol/li), blockquotes, horizontal rules (hr), and tables (thead/tbody/tr/th/td). Block-level containers like div, section, and article pass through their children.

Is my HTML uploaded to a server?

No. The entire conversion happens in your browser using the DOM parser API. Your HTML is never sent to any server, making it safe to convert internal documentation or private content.

Why might my converted Markdown not render exactly like the original HTML?

Markdown is a simpler format than HTML and cannot represent everything HTML can. Inline styles (colors, font sizes, alignment) and custom class attributes are stripped during conversion. Nested lists may lose nesting if deeply nested. Use the output as a starting point and make manual adjustments for complex layouts.

How does code block language detection work?

The converter looks for a class attribute on the <code> element following the pattern "language-<name>" (e.g., language-javascript, language-python). This is the CommonMark standard used by syntax highlighters like Prism and highlight.js. If no language class is found, the fenced code block is output without a language specifier.

Can I convert a full webpage or just fragments?

Both work. If you paste a full HTML document, the converter processes the body content. For most use cases, pasting just the relevant content section (e.g., an article body) produces cleaner results, as navigation menus and footer markup tend to produce noisy Markdown.

Công cụ liên quan

Markdown → HTMLMarkdown Table GeneratorHTML FormatterHTML Entity EncoderText Diff