Skip to main content

Markdown Converter

Convert between Markdown and HTML, with live preview

Two-way conversionLive previewSyntax cheat sheet

Output

Markdown cheat sheet

SyntaxRenders as
# 标题一级标题(h1),## 是二级、### 是三级
**粗体**加粗
*斜体*斜体
~~删除线~~删除线
`代码`行内代码
```\n代码块\n```代码块
[链接](https://example.com)超链接
![描述](图片地址)图片
> 引用引用块
- 项目无序列表
1. 项目有序列表
---水平分割线
| 表头 | 表头 |\n|---|---|\n| 内容 | 内容 |表格(前后需空行)
\*转义\*反斜杠转义,输出原字符
行尾两空格强制换行(<br>)
<div>HTML</div>内联 HTML 原样保留

Last updated: 2026-10-11

About this tool

Writing docs in Markdown and publishing them as HTML is a constant need, and this tool handles both directions. Converting Markdown to HTML gives you a live preview so the result is what you see; converting HTML to Markdown produces clean markup wherever possible. The converter is a compact implementation of our own rather than a heavy dependency, so the rules are transparent and predictable. Everything is processed in your browser, making it safe for unpublished drafts and internal documents.

Features

Markdown → HTML

Supports headings, bold, italic, links, images, lists, blockquotes, code blocks, tables and horizontal rules, with a live preview on the right.

HTML → Markdown

Turns an HTML fragment back into Markdown, handy when migrating to a Markdown-based platform.

Live preview

While converting Markdown to HTML the preview renders as you type, so a single edit is immediately visible.

Cheat sheet built in

A reference table of common Markdown syntax sits right on the page — no need to switch tabs.

XSS risk warning

If the output contains raw HTML tags or scripts you get a warning: inserting it into a page directly is an XSS risk. The preview area is sandboxed.

Content stats

Word count, character count, headings, links and code blocks, for a quick sense of the length.

How to use

  1. 1

    Choose a direction

    Pick "Markdown → HTML" or "HTML → Markdown".

  2. 2

    Enter your content

    Paste the source into the input box; output is generated live.

  3. 3

    Read the output

    The output box holds the converted text; Markdown-to-HTML mode also shows a live preview.

  4. 4

    Copy or adjust

    Copy the result, or check the cheat sheet to tweak your syntax.

Options

Direction
Markdown to HTML (with preview) or HTML to Markdown.

Common use cases

  • Converting Markdown notes into HTML to embed in a page or email
  • Turning an HTML fragment you were given back into Markdown for a docs platform
  • Previewing how Markdown will render before publishing a post
  • Checking the cheat sheet when you forget a syntax detail

FAQ

Questions you may have about this tool

Is the output safe to put on my website?

It depends on whether you trust the input. If the input contains a <script> tag or an image with an onerror handler, it is preserved verbatim and inserting it into a page is an XSS risk. When handling untrusted content, always sanitize it with a library such as DOMPurify.

Which Markdown syntax is supported?

Common syntax is covered: headings, bold, italic, strikethrough, inline code, code blocks, links, images, ordered and unordered lists, blockquotes, tables and horizontal rules. This is a compact implementation, so extensions like footnotes and math are not included.

Does HTML → Markdown round-trip perfectly?

No. HTML is far more expressive than Markdown: inline styles, deeply nested tables and custom attributes have no Markdown equivalent and are simplified or dropped. Review the result by hand.

Is content uploaded?

No. Conversion happens entirely in the browser, so unpublished drafts and internal documents are safe to use. You can confirm there are no network requests in developer tools.

Why is my table not rendering?

Markdown table syntax is strict: there must be a blank line before and after the table, and the separator row (---) must have the same number of columns as the header. Checking those two things usually fixes it.

Does the converted HTML come with styling?

No. The output is semantic plain HTML (h1, p, strong and so on) with no inline styles or classes — styling is up to the page it lands in.

Can I convert multiple files at once?

This is a single-text converter. For batch work, a command-line tool such as pandoc is a better fit for automation.

How are line breaks handled?

In Markdown a single newline does not produce a <br>; you need a blank line to start a new paragraph. For a hard break, add two trailing spaces. It is a common point of confusion — the preview lets you verify it directly.