Markdown 轉 HTML

將 Markdown 轉換為乾淨的 HTML,支援富文字編輯、即時預覽和可自訂的轉換選項。非常適合開發者和內容創作者。

定義: CommonMark 是一份完整、無歧義的 Markdown 規範:區塊構造(標題、清單、圍欄程式碼區塊)與行內片段(強調、連結、程式碼)直接對應到 HTML 元素。

CommonMark 規範 最後更新: 2026-11

快速參考

# Heading 標題
**bold** 粗體
*italic* 斜體
[text](url) 連結
- item 清單
`code` 程式碼

如何使用 Markdown 轉 HTML 轉換器

1

輸入 Markdown

在輸入區輸入或貼上 Markdown

2

自動轉換

開啟自動轉換,即時產生 HTML

3

預覽

在程式碼檢視和即時預覽之間切換

4

匯出

複製 HTML,或下載為完整的 .html 檔案

理解 Markdown 轉 HTML

什麼是 Markdown 轉 HTML?

Markdown 轉 HTML 可將簡單的 Markdown 文字轉換為格式正確的 HTML 標記。這讓您以便於閱讀的格式撰寫內容,並發布為可直接上線的 HTML。

  • • 簡潔語法: 易於書寫的格式語法
  • • 整潔的 HTML: 語意化、符合標準的輸出
  • • 即時預覽: 邊輸入邊查看結果
  • • 完整支援: 標題、清單、連結、程式碼區塊

為什麼使用 Markdown 轉 HTML?

Markdown 非常適合在不處理複雜 HTML 標籤的情況下撰寫內容。將您的筆記、檔案或部落格文章轉換為 HTML 以便在網路上發布。

  • • 輕鬆寫作: 專注內容而非語法
  • • 網頁發佈: 為網站建立 HTML
  • • 電子郵件範本: 產生 HTML 電子郵件
  • • 文件: 將 README 檔案轉換為網頁

即時預覽

在程式碼檢視和渲染預覽之間切換,精確檢視內容最終的呈現效果。

100% 隱私

所有轉換均在本機完成。您的 Markdown 絕不會被傳送到任何伺服器。

完全免費

無需註冊,沒有限制。無限量地將 Markdown 轉換為 HTML,永久免費。

用文字分析和格式整理工具提升效率

`; const blob = new Blob([fullHtml], { type: 'text/html' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'converted.html'; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); } function clearAll() { const markdownInput = document.getElementById('markdown-input'); markdownInput.value = ''; markdownInput.dispatchEvent(new Event('input', { bubbles: true })); document.getElementById('html-output').value = ''; updateInputPreview(); updateOutputPreview(); } // 文本草稿(O2 批量):编辑即存、回访恢复。须在 OhMonaco.attach 之前执行——Monaco 以 textarea 值初始化; // Monaco 同步链路会向 textarea 派发 input 事件,故存草稿挂 textarea 一处即可覆盖编辑器/纯文本双模式。隐私模式静默降级。 (function () { var KEY = 'ohtb:markdown-to-html:draft'; var textarea = document.getElementById('markdown-input'); if (!textarea) return; try { var draft = localStorage.getItem(KEY); if (draft) textarea.value = draft; } catch (e) { /* 静默 */ } var timer = null; textarea.addEventListener('input', function () { clearTimeout(timer); timer = setTimeout(function () { try { if (textarea.value) localStorage.setItem(KEY, textarea.value); else localStorage.removeItem(KEY); } catch (e) { /* 静默 */ } }, 300); }); // 页面各监听器就位后再等价触发一次 input,让统计/转换对已恢复草稿生效 document.addEventListener('DOMContentLoaded', function () { // 延后一拍:等页面在 DOMContentLoaded 里绑定的统计/转换监听就位后再触发 setTimeout(function () { if (textarea.value) textarea.dispatchEvent(new Event('input', { bubbles: true })); }, 0); }); })(); document.addEventListener('DOMContentLoaded', function() { const markdownInput = document.getElementById('markdown-input'); const auto = document.getElementById('auto-convert'); markdownInput.addEventListener('input', function () { if (auto.checked) { convert(); } }); if (window.OhMonaco) { window.OhMonaco.attach({ textareaId: 'markdown-input', containerId: 'markdown-input-editor', toggleId: 'markdown-to-html-monaco-toggle', themeSelectId: 'markdown-to-html-monaco-theme', language: 'markdown', onChange: () => { if (auto.checked) { convert(); } }, }); } const monacoToggle = document.getElementById('markdown-to-html-monaco-toggle'); if (monacoToggle) { monacoToggle.addEventListener('change', function () { setTimeout(() => { if (inputMode === 'edit') { applyModeUI(); } }, 0); }); } convert(); applyModeUI(); });