HTML 轉 Markdown 轉換器
上傳 HTML 檔案或貼上頁面網址,即可取得乾淨易讀的 Markdown。ParseJet 能處理現實世界中雜亂的 HTML — 巢狀 div、行內樣式、老舊標記 — 並把每個元素對應到正確的 Markdown 語法。專為內容遷移、技術文件和 LLM 管線打造。
將檔案拖放到此處或 瀏覽
接受 HTML,HTM 檔案
免費 — 每日 3 次請求,無需註冊。 即可獲得每月 300 點免費額度。
運作原理
上傳 HTML 或貼上網址
將 .html 檔案拖曳至上方,或貼上線上頁面的網址。兩種方式都會產生同樣乾淨的 Markdown 輸出。
轉換為 Markdown
ParseJet 會解析 HTML,捨棄 script、樣式和追蹤程式碼,並把標題、清單、表格、連結和程式碼區塊對應到 Markdown。
複製或使用 API
直接複製結果,或在您的應用程式或遷移腳本中整合 API,把 HTML 轉換為 Markdown。
主要功能
這個 html to markdown 的突出之處。
完整元素對應
h1–h6、有序與無序清單、表格、區塊引言、程式碼區塊、粗體/斜體和連結,全都會轉換成對應的 Markdown 語法。
雜亂的 HTML 也能處理
現實中的 HTML 很少是乾淨的。未關閉的標籤、層層巢狀的 div、行內樣式和老舊標記,ParseJet 都能處理,不會讓輸出出錯。
移除 script 與樣式
JavaScript、CSS、追蹤像素和 HTML 註解會被完全移除 — 一點都不會混進您的 Markdown。
支援檔案或網址輸入
可以轉換儲存下來的 .html 檔案(例如 WordPress 匯出檔),也可以用網址抓取線上頁面 — 同一個端點都能處理。
字元實體與編碼安全
HTML 字元實體(&、 、—)會解碼成真正的字元,輸出一律為 UTF-8 — 您的 Markdown 不會出現亂碼。
透過 API 批次轉換
用一段簡短的腳本,就能把整個匯出資料夾的 HTML 檔案轉成 Markdown。請參考下方的 Python 範例。
使用案例
此工具為您節省時間的常見情境。
CMS 與部落格遷移
把 WordPress、Ghost 或舊版 CMS 的內容搬到 Hugo、Astro、Jekyll 等以 Markdown 為主的技術堆疊 — 不必手動清理 HTML。
技術文件轉換
將 HTML 格式的技術文件和 Wiki 匯出檔(Confluence、MediaWiki)轉換成 Markdown,用於 Git 上的文件即程式碼工作流程。
LLM 輸入前處理
原始 HTML 會把 token 浪費在標記雜訊上。先轉成 Markdown,模型拿到的就是精簡、結構完整的文字,文件層級也不會遺失。
爬蟲管線的輸出
把爬蟲收集到的 HTML 轉成乾淨的 Markdown,用於儲存、建立索引或後續的 NLP 處理 — 每份文件只要一次 API 呼叫。
使用 API 自動化
以程式化方式使用相同工具。適用於任何語言 — 僅需 HTTP。
# Convert a local HTML file to Markdown curl -X POST https://api.parsejet.com/v1/parse/auto/file \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "[email protected]" # Convert a live page by URL curl -X POST https://api.parsejet.com/v1/parse/webpage \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com/page"}'
import httpx
from pathlib import Path
# Batch-convert an HTML export folder to Markdown files
html_dir = Path("export/")
md_dir = Path("markdown/")
md_dir.mkdir(exist_ok=True)
for html_file in html_dir.glob("*.html"):
resp = httpx.post(
"https://api.parsejet.com/v1/parse/auto/file",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"file": (html_file.name, html_file.read_bytes(), "text/html")},
)
md_path = md_dir / html_file.with_suffix(".md").name
md_path.write_text(resp.json()["text"], encoding="utf-8")
print(f"Converted {html_file.name} -> {md_path.name}") // Convert an HTML file (e.g. from a file input) to Markdown
const formData = new FormData();
formData.append("file", htmlFile); // File or Blob with .html content
const res = await fetch("https://api.parsejet.com/v1/parse/auto/file", {
method: "POST",
headers: { Authorization: "Bearer YOUR_API_KEY" },
body: formData,
});
const { text } = await res.json();
console.log(text); // Markdown string 常見問題
如何把 HTML 轉換成 Markdown?
在上方上傳 .html 檔案或貼上頁面網址。ParseJet 會解析標記,並回傳保留標題、清單、表格和連結的乾淨 Markdown。要自動化的話,POST 到 /v1/parse/auto/file 或 /v1/parse/webpage。
表格會正確轉換嗎?
會。HTML 表格會變成含標頭列與對齊欄位的 Markdown 表格。巢狀清單、區塊引言和程式碼區塊也會對應到相應的 Markdown 語法。
script、樣式和註解會被怎麼處理?
會被完全移除。輸出只包含文件中可閱讀的內容 — 沒有 JavaScript、CSS 或追蹤程式碼。
可以直接轉換線上網頁,而不是檔案嗎?
可以。在上方工具貼上網址,或使用「網頁轉 Markdown」工具 — 那個工具特別針對擷取線上頁面的主要內容、移除導覽列和廣告做過最佳化。
如何在 Python 中把 HTML 轉成 Markdown?
用 httpx 或 requests 把檔案 POST 到 /v1/parse/auto/file — 回應中的 "text" 欄位就是您的 Markdown。不必安裝 html2text、BeautifulSoup 或 markdownify。可參考上方的 Python 範例。
這是免費的嗎?
是的。無需註冊即可每天免費轉換 3 次。建立免費帳戶可獲得每月 300 點數。付費方案每月 19 美元起,適合大量遷移作業。
相關工具
URL to Markdown Converter
Convert any URL to clean Markdown online for free. Paste a link and get the page's main content as Markdown — no ads, no navigation. API available.
Word to Markdown Converter
Convert Word documents (DOCX) to Markdown online for free. Headings, lists, and tables preserved. No signup — or automate DOCX to MD conversion via API.
PDF to Markdown Converter
Convert PDF to Markdown online for free. Preserves headings, lists, tables, and code blocks. No signup required — try it instantly or automate via API.