File contents DOCX to Markdown Skill
Convert DOCX files to well-formatted markdown files with images extracted.
Usage
python3 docx_to_markdown.py "<docx_path>" -o "<output_path>"
Features
Metadata extraction : title, author, subject, keywords
Heading preservation : Maintains H1-H6 hierarchy from Word styles
Inline formatting : Bold, italic conversion
List support : Ordered and unordered lists
Table extraction : Tables converted to markdown format
Image extraction : Extracts images to _files_/ folder with document prefix
Output Structure
output_dir/
├── document.docx # Original file
├── document.md # Extracted markdown
└── _files_/ # Images folder
├── DocTitle_image1.png
├── DocTitle_figure2.jpg
└── ...
Image Prefix
Images are extracted with a document prefix derived from the title:
Title: "Die Empty: Unleash Your Best Work Every Day"
Prefix: DieEmptyUnleash (first 3 words, special chars removed)
Image: _files_/DieEmptyUnleash_image1.png
This prevents filename collisions when extracting multiple documents to the same folder.
Output Format
---
title: {from metadata}
author: {from metadata}
source_file: original.docx
source_type: docx
extracted: YYYY-MM-DD HH:MM:SS
status: extracted
---
# {Document Title}
{content with  links}
Dependencies
pip install python-docx
Or use requirements.txt:
pip install -r requirements.txt
Options
Flag
Description
-o, --output
Output markdown file path (default: same as docx with .md)
-q, --quiet
Suppress progress messages
Limitations
Password-protected DOCX : Cannot be opened (will fail with error)
Complex layouts : May not preserve exact positioning
Embedded objects : Non-image objects may not be extracted
1 --- 2 name: docx-to-markdown 3 description: DOCX to Markdown Skill 4 --- 5 # DOCX to Markdown Skill 6 7 Convert DOCX files to well-formatted markdown files with images extracted. 8 9 ## Usage 10 11 ```bash 12 python3 docx_to_markdown.py "<docx_path>" -o "<output_path>" 13 ``` 14 15 ## Features 16 17 - **Metadata extraction**: title, author, subject, keywords 18 - **Heading preservation**: Maintains H1-H6 hierarchy from Word styles 19 - **Inline formatting**: Bold, italic conversion 20 - **List support**: Ordered and unordered lists 21 - **Table extraction**: Tables converted to markdown format 22 - **Image extraction**: Extracts images to `_files_/` folder with document prefix 23 24 ## Output Structure 25 26 ``` 27 output_dir/ 28 ├── document.docx # Original file 29 ├── document.md # Extracted markdown 30 └── _files_/ # Images folder 31 ├── DocTitle_image1.png 32 ├── DocTitle_figure2.jpg 33 └── ... 34 ``` 35 36 ## Image Prefix 37 38 Images are extracted with a document prefix derived from the title: 39 - Title: "Die Empty: Unleash Your Best Work Every Day" 40 - Prefix: `DieEmptyUnleash` (first 3 words, special chars removed) 41 - Image: `_files_/DieEmptyUnleash_image1.png` 42 43 This prevents filename collisions when extracting multiple documents to the same folder. 44 45 ## Output Format 46 47 ```markdown 48 --- 49 title: {from metadata} 50 author: {from metadata} 51 source_file: original.docx 52 source_type: docx 53 extracted: YYYY-MM-DD HH:MM:SS 54 status: extracted 55 --- 56 57 # {Document Title} 58 59 {content with  links} 60 ``` 61 62 ## Dependencies 63 64 ```bash 65 pip install python-docx 66 ``` 67 68 Or use requirements.txt: 69 ```bash 70 pip install -r requirements.txt 71 ``` 72 73 ## Options 74 75 | Flag | Description | 76 |------|-------------| 77 | `-o`, `--output` | Output markdown file path (default: same as docx with .md) | 78 | `-q`, `--quiet` | Suppress progress messages | 79 80 ## Limitations 81 82 - **Password-protected DOCX**: Cannot be opened (will fail with error) 83 - **Complex layouts**: May not preserve exact positioning 84 - **Embedded objects**: Non-image objects may not be extracted
jykim/claude-obsidian-skills/tree/main/docx-to-markdown commit 451c19f5b5
Frequently asked questions How do I install the DOCX To Markdown skill? Run npx skillmds@latest add jykim/docx-to-markdown in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the DOCX To Markdown skill do? DOCX to Markdown Skill It is listed under Docs & Writing on SkillMD.
Is DOCX To Markdown safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with DOCX To Markdown? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is DOCX To Markdown free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published DOCX To Markdown? jykim (@jykim) published this skill. Their other Agent Skills are listed on their SkillMD profile.