A Claude Code skill that converts Microsoft Word documents (.doc/.docx) to clean, well-structured Markdown with full image preservation.
- ✅ Full Format Support - Converts both .doc (legacy) and .docx (modern) formats
- ✅ Image Preservation - Extracts images to separate folders with proper references
- ✅ Smart Content Cleanup - Automatically removes Word comment markers, revision history, and TOC links
- ✅ Content-Hash Matching - Ensures correct image order (Figure 1 maps to correct image)
- ✅ Watermark Exclusion - Skips header/footer logos automatically
- ✅ WMF/EMF Conversion - Converts Windows Metafile formats to PNG
- ✅ Two Output Modes - External images (default) or embedded base64
- ✅ Batch Processing - Convert multiple documents at once
# Clone the repository to your Claude skills directory
cd ~/.claude/skills
git clone https://github.com/YOUR-USERNAME/doc-to-markdown-skill.git doc-to-markdownOr download and extract manually:
mkdir -p ~/.claude/skills
cd ~/.claude/skills
# Download and extract the zip file here
unzip doc-to-markdown.zipThe converter will use uvx (from uv) if available. If uvx is not installed, it will fall back to a markitdown executable on PATH.
brew install uvpip install 'markitdown[all]'markitdown requires Python 3.10+.
brew install --cask libreofficeThe skill will automatically load on the next Claude Code session.
The skill activates automatically when you ask Claude to convert Word documents.
Convert document.docx to markdown
Extract specification.doc to markdown with images
Convert all Word files in this folder to markdown
Batch convert all .docx files in the specs directory
Convert document.docx to markdown with embedded images
original-document.docx # Original Word file
original-document.md # Clean Markdown (2-3KB)
original-document_images/ # Extracted images folder
├── image1.png
├── image2.png
└── ...
original-document.docx # Original Word file
original-document.md # Markdown with base64 images (large file)
- Detects Format - Automatically handles .doc or .docx files
- Extracts Images - Pulls images from Word document (excluding headers/footers)
- Converts to Markdown - Uses markitdown CLI tool
- Matches Images - Content-hash matching ensures correct image order
- Cleans Content - Removes redundant Word markers and revision history
- Creates Output - Generates clean Markdown with proper image references
- Word comment markers:
[///txt],[/***],[***/],[txt///] - Revision history:
~~strikethrough text~~,(removed) - Word TOC links:
[1 Arc 4](#_Toc200457262) - Result: ~35% file size reduction
.docx- Office 2007+.doc- Legacy Office formats
- PNG, JPG/JPEG
- EMF (Enhanced Metafile - converted to PNG)
- BMP, GIF, and other embedded formats
Solution: Ensure markitdown is installed with all dependencies:
pip install 'markitdown[all]'Cause: LibreOffice GUI is already running - headless mode cannot start
Solution:
# Close all LibreOffice windows and quit the application
killall soffice
# Or check if LibreOffice is running
pgrep -lf sofficeSolution:
- Ensure image folder is in the same directory as the .md file
- WMF/EMF files are automatically converted to PNG
Solution: The skill uses content-hash matching to solve this - ensure you're using the latest version
convert_word_to_markdown.py- Main unified converterconvert_with_images.py- Core conversion logic with image extractionconvert_doc_to_docx.py- Legacy .doc to .docx converterclean_markdown.py- Content cleanup utilities
- Python 3.6+
- markitdown (with all dependencies)
- LibreOffice (optional, for .doc files)
User: Convert AV2_VE_DAMR_OPFL_arch_spec.docx to Markdown
Claude: I'll convert this document using the doc-to-markdown skill.
Result:
✓ Extracted 13 images to AV2_VE_DAMR_OPFL_arch_spec_images/
✓ Created AV2_VE_DAMR_OPFL_arch_spec.md (2,121 bytes, 92 lines)
✓ Removed 50 redundant lines
User: Convert all VE architecture documents to Markdown
Claude: Found 5 Word documents. Converting...
Result:
✓ Converted 5 documents
✓ Extracted 47 total images
✓ Created 5 markdown files
Feel free to submit issues and enhancement requests!
MIT License - Feel free to use and modify
Created for Claude Code users who need to convert Word documents to Markdown while preserving all content and images.
1.0.0 - Initial release
For detailed documentation, see SKILL.md in the skill directory.