Ask HN: How should I convert Microsoft Word documents to Markdown?
9 comments
Pandoc is awesome for this:
`pandoc input.docx -o output.md`
There's more you can do, with style sheets and so on, which you will likely have to dig into for the tables and multiple columns to come out the way you want. You can also extract media files from inside a docx file:
`pandoc --extract-media=. input.docx -o output.md`
Native support: https://techcommunity.microsoft.com/blog/onedriveblog/introd...
Microsoft OSS python: https://github.com/microsoft/markitdown
There seem to be many addons that enable this, and pandoc as others have suggested
Microsoft OSS python: https://github.com/microsoft/markitdown
There seem to be many addons that enable this, and pandoc as others have suggested
I'd give an llm a shot before I ruled it out.
I had it generating .docx the other day and it did pretty well, so I assume it understands the format just fine.
And they're excellent at markdown.
I had it generating .docx the other day and it did pretty well, so I assume it understands the format just fine.
And they're excellent at markdown.
sure but OOXML is on avg 12x~ larger than markdown so you'll burn a ton of tokens. I second using pandoc but depends on why you need it to be in markdown in the first place?
(source - I'm working on a docx MCP that abstracts OOXML complexity away from LLMs entirely)
(source - I'm working on a docx MCP that abstracts OOXML complexity away from LLMs entirely)
Start with pandoc before reinventing the wheel.
Pandoc might be able to do this, found this:
https://gist.github.com/plembo/409a8d7b1bae66622dbcd26337bbb...
https://gist.github.com/plembo/409a8d7b1bae66622dbcd26337bbb...
Claude Code can do these types of really well unless you're trying to convert in bulk
[deleted]
Pandoc can do this I think
What I notice is that LibreOffice can create very complex PDFs when the Microsoft Word document has:
1. tables
2. multiple columns
3. strikethrough text
I am thinking we should go straight from Microsoft Word to Markdown.
What is the right software for that?