Docx to Md

Use GroupDocs.Markdown to convert DOCX and other Word documents to clean Markdown.

Using static method

The simplest way to convert a Word file:

import com.groupdocs.markdown.*;

import java.io.File;

public class ExportWordStatic {

    public static void main(String[] args) {
        // Set license (optional)
        if (new File("GroupDocs.Markdown.lic").exists()) {
            License.set("GroupDocs.Markdown.lic");
        }

        // Convert DOCX to Markdown string
        String markdown = MarkdownConverter.toMarkdown("business-plan.docx");

        // Or save directly to a file
        MarkdownConverter.toFile("business-plan.docx", "export-word-static.md");
    }
}

business-plan.docx is a sample file used in this example. Click here to download it.

![](data:...;base64,[elided])

**Meridian Outdoor Co. — Business Plan**

FY2026 Strategic Plan


# **Table of Contents**

FY2026 Strategic Plan	1
[TRUNCATED]

Download full output

Using instance API with options

For more control, use the instance API:

import com.groupdocs.markdown.*;

import java.io.File;

public class ExportWordInstance {

    public static void main(String[] args) {
        if (new File("GroupDocs.Markdown.lic").exists()) {
            License.set("GroupDocs.Markdown.lic");
        }

        try (MarkdownConverter converter = new MarkdownConverter("business-plan.docx")) {
            ExportImagesToFileSystemStrategy strategy = new ExportImagesToFileSystemStrategy("images");
            strategy.setImagesRelativePath("images");

            DocumentConvertOptions options = new DocumentConvertOptions();
            options.setImageExportStrategy(strategy);
            options.setHeadingLevelOffset(1);

            converter.convert("export-word-instance.md", options);
        }
    }
}

business-plan.docx is a sample file used in this example. Click here to download it.

export-word-instance.md (5 KB)

Download full output

For the full list of input formats, see the supported formats page.

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.