# Docx to Md This article demonstrates how to convert Words to Markdown with GroupDocs.Markdown for Python via .NET. Use GroupDocs.Markdown to convert DOCX and other Word documents to clean Markdown. ### Using static method The simplest way to convert a Word file: {{< tabs "export-word-static">}} {{< tab "export_word_to_markdown.py" >}} ```python import os from groupdocs.markdown import License, MarkdownConverter def export_word_to_markdown(): """Convert a Word document to Markdown using the static one-liner API.""" # Step 1: Apply the license (optional for evaluation) if os.path.exists("GroupDocs.Markdown.lic"): License.set_("GroupDocs.Markdown.lic") # Step 2: Convert the Word document directly to a Markdown file MarkdownConverter.to_file("business-plan.docx", "export-word-static.md") if __name__ == "__main__": export_word_to_markdown() ``` {{< /tab >}} {{< tab "business-plan.docx" >}} {{< tab-text >}} `business-plan.docx` is sample file used in this example. Click [here](https://docs.groupdocs.com/markdown/python-net/_sample_files/developer-guide/basic-usage/convert/business-plan.docx) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "export-word-static.md" >}} ```text ![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAC0CAYAAABIf1IMAAAABHNCSVQICAgIfAhkiAAADcJJREFUeJzt3VFo3VWeB/BfF2EfdJraSWKkpovabiokaRZcfWiM4jCS0mELjvgwzlZt16fdlUFpKbLCgDKELQ7Oum+yNdYdH4StCLMkdBexSfow7sC0SUA7TZVJW0zbWI1OF/ap+xD+/97k/u/Nze1JbJLPBwo9/3vu/Z1/L5Qv55x7/uumJkauBQAAyfzZdz0AAIDVRsACAEhMwAIASEzAAgBI7Jaii//67/8dZ89dSlbkH576Qdy7+Y4F+6Wqq5566qmnnnrqqbdc9YoUBqyJyYsxevrcDQ2q1LdX/6+mfqnqqqeeeuqpp5566i1XvSKFAWvL5jti3bp1cXbyYvzpf+v/cACAtWhZZrAAANaSdUUHjf7sF7+eE7D+/qkfxL2t9a1BRszOiN12658v2O [TRUNCATED] ``` [Download full output](https://docs.groupdocs.com/markdown/python-net/_output_files/developer-guide/basic-usage/convert/export-wordprocessing/export_word_to_markdown/export-word-static.md) {{< /tab >}} {{< /tabs >}} ### Using instance API with options For more control, use the instance API: {{< tabs "export-word-instance">}} {{< tab "export_word_with_options.py" >}} ```python import os from groupdocs.markdown import License, MarkdownConverter, ConvertOptions, ExportImagesToFileSystemStrategy def export_word_with_options(): """Convert a Word document to Markdown using the instance API with image export and heading offset.""" # Step 1: Apply the license (optional for evaluation) if os.path.exists("GroupDocs.Markdown.lic"): License.set_("GroupDocs.Markdown.lic") # Step 2: Open the DOCX document with a context manager with MarkdownConverter("business-plan.docx") as converter: # Step 3: Configure the image export strategy to save images to disk strategy = ExportImagesToFileSystemStrategy("images") strategy.images_relative_path = "images" # Step 4: Set conversion options options = ConvertOptions() options.image_export_strategy = strategy options.heading_level_offset = 1 # shift all headings down one level # Step 5: Convert and save the Markdown output converter.convert("export-word-instance.md", convert_options=options) if __name__ == "__main__": export_word_with_options() ``` {{< /tab >}} {{< tab "business-plan.docx" >}} {{< tab-text >}} `business-plan.docx` is sample file used in this example. Click [here](https://docs.groupdocs.com/markdown/python-net/_sample_files/developer-guide/basic-usage/convert/business-plan.docx) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "export-word-options.zip" >}} ```text export-word-instance.md (5 KB) images/img-001.png (4 KB) images/img-002.jpg (41 KB) images/img-003.png (14 KB) ``` [Download full output](https://docs.groupdocs.com/markdown/python-net/_output_files/developer-guide/basic-usage/convert/export-wordprocessing/export_word_with_options/export-word-options.zip) {{< /tab >}} {{< /tabs >}} For the full list of input formats, see the [supported formats page]({{< ref "markdown/python-net/getting-started/supported-document-formats" >}}).