Word to Markdown
Word documents to Markdown without opening Word
- markdown
You've got a .docx - a report, a contract, a spec - sitting on disk, and you want it as clean Markdown so an LLM node can read it or you can skim it without Office. That's this node's entire job, and it does it in one step. One path in, one Markdown string out.
How it works
Like every converter in this pack, Word2Markdown is a subclass of the generic MarkItDown node with a strict extension whitelist: .docx, and nothing else - wrong extensions raise Only support: ['.docx']. Under the hood markitdown hands the file to mammoth, the library that reads .docx files without Word, then converts the result through markdownify into Markdown. Headings, paragraphs, lists, and tables come through in good shape - that's mammoth's specialty. What you lose is layout: margins, page breaks, and any styling are gone, which is exactly what you want when the goal is feeding text to a model.
The inputs and outputs that matter
One input, source_file, a STRING with the absolute path to your Word file. One output, markdown, a STRING to wire into a text viewer or any LLM context node. There are no knobs, no options, no settings to misconfigure. It's hard to make this node do the wrong thing - the main ways to fail are giving it the wrong path or the wrong extension.
Why you'd reach for it
ComfyUI workflows increasingly touch text as well as images, and .docx is one of the most common text containers on anyone's drive. If you're building a document-summarization or RAG-style workflow, this is the cleanest way to get a Word doc into a string that an LLM node can consume. It's also genuinely useful outside LLMs: converting a doc to Markdown makes it diffable, greppable, and paste-friendly.
Installing it
Part of the ComfyUI-MarkItDown pack - install once, use all nine converters:
cd ComfyUI/custom_nodes
git clone https://github.com/ciga2011/ComfyUI-MarkItDown
Or ComfyUI Manager, search "ComfyUI MarkItDown", install, restart. The Word support rides in on markitdown's transitive dependencies; nothing heavy, no models.
Gotchas
Two things to remember. First, it's .docx only - the legacy .doc format is not supported, and the extension check will reject it before markitdown even gets a chance to try. Convert legacy files to .docx first if you're stuck with them. Second, tracked changes and comments don't come through - you get the visible text of the document, which is usually what you wanted anyway.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| source_file | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| markdown | STRING | — |