Skip to content
cosmodev ~/tools/markdown-to-html

Markdown → HTML 转换器

Converters & Formatters

将 Markdown 渲染为干净的转义 HTML:标题、列表、链接、图片、代码块和引用。所有输入都会先转义,因此输出始终是安全的标记。本地运行,支持通过链接分享。

试一试:

(文档为英文)

What it does

Renders a practical Markdown subset into clean HTML: ATX headings (#–######), fenced code blocks with language classes, block quotes, ordered and unordered lists, horizontal rules, and inline marks — bold, italic, strikethrough, code spans, links and images. Everything is HTML-escaped before the inline rules run, so raw HTML in your input renders as visible text, never as markup. The output is a block per line group, ready to paste into any template. Everything runs locally in your browser.

How to use it

  1. Paste Markdown into Markdown (left), or tap a chip — README, Blog post, Code. Sample loads a release-notes document; Clear empties the box.
  2. The HTML appears live in HTML output (right).
  3. Copy takes the markup.
  4. Copy share link encodes your input in the URL.

Examples

Headings and marks:

# Title → <h1>Title</h1> · **b** *i* ~~s~~ \c`→b i s c`

A fenced block with a language:

```js
const x = 1;
```

→ <pre><code class="language-js">const x = 1;</code></pre>

Raw HTML stays visible and inert:

<script>alert(1)</script> → &lt;script&gt;alert(1)&lt;/script&gt; — escaped, not executed.

What the subset covers

Supported Not supported (by design)
ATX headings, hr, paragraphs setext headings, tables
Fenced code (```), inline code indented code blocks
- / * / + and 1. lists (flat) nested lists, task lists
> quotes (nesting other blocks inside) lazy quote continuation
**bold**, *italic*, ~~strike~~ reference links, footnotes
[t](u), ![alt](src) autolinks, raw HTML passthrough

The escape-first order is the contract: what you typed is what shows up as text, and only the subset above becomes tags. For the other direction, use HTML to Markdown Converter.

源代码14 种语言

100% 客户端运行 · 你的数据永远不会离开浏览器。 觉得好用?分享给同事吧。