HTML to Markdown
A saved web page becomes clean reading text, scripts and all stripped
- markdown
Ever saved a webpage "for later," opened it months on, and waded through a wall of <div> soup and tracking scripts to find the actual article? That's the problem this node solves. HTML2Markdown takes a local .html or .htm file and returns the page's real content as clean Markdown - navigation, scripts, and styling gone, text and headings left behind.
How it works
Like its siblings in ComfyUI-MarkItDown, this is a subclass of the generic MarkItDown node, whitelisted to .html and .htm. markitdown parses the page with BeautifulSoup and converts the content through markdownify, producing standard Markdown: headings, paragraphs, links, images as ![]() references. There's one genuinely nice touch in the library: markitdown has special handling for Wikipedia pages, so those come out particularly readable. The mechanism is pure text processing - no rendering, no browser, no network calls. It only reads the file you point it at.
The inputs and outputs that matter
One input: source_file, a STRING holding the absolute path to your HTML file. One output: markdown, a STRING ready for a text viewer, a save node, or an LLM context node. No settings exist to tweak, which keeps the failure surface small: wrong path or wrong extension is about all that can go wrong, and the extension check rejects anything outside .html/.htm.
Why you'd reach for it
Mostly for the same reason the rest of the pack exists: turning messy document formats into text an LLM can actually read. Saved articles, offline documentation, exported email digests - all of it becomes one clean Markdown string you can feed into a summarization workflow or just grep through. If you have a live URL instead of a local file, the generic WIZ_MARKITDOWN node accepts URLs directly; this one is specifically for files on disk.
Installing it
It's part of the ComfyUI-MarkItDown pack:
cd ComfyUI/custom_nodes
git clone https://github.com/ciga2011/ComfyUI-MarkItDown
Restart ComfyUI, or use Manager (search "ComfyUI MarkItDown"). HTML conversion is handled entirely by markitdown's bundled Python dependencies - nothing to download, no models.
Gotchas
The output is as good as the source. JavaScript-rendered pages saved as HTML have no text in the file to extract - you get the shell and the scripts stripped to nothing. If a page was saved from a browser before its content loaded, there's nothing to salvage. And complex layouts, especially multi-column tables, can come out flattened or jumbled. For a plain article or documentation page, though, this is one of the most reliable converters in the pack.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| source_file | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| markdown | STRING | — |