Quick start guide
Leave feedback
On this page
This guide shows you how to convert documents to Markdown with GroupDocs.Markdown for Java. You’ll have working code in under 2 minutes.
flowchart LR
A["Input Document\n(DOCX, PDF, XLSX, EPUB, ...)"]
B["MarkdownConverter"]
C["Markdown Output\n(.md file or string)"]
A --> B --> C
- Add the GroupDocs repository and the dependency to your
pom.xml(see Installation for Gradle, Kotlin, Ivy, and Sbt):
<repositories>
<repository>
<id>GroupDocs Artifact Repository</id>
<url>https://releases.groupdocs.com/java/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-markdown</artifactId>
<version>latest-version</version>
</dependency>
</dependencies>
- Import the package:
import com.groupdocs.markdown.*;
The simplest conversion — one line of code:
import com.groupdocs.markdown.*;
public class QsWordToMd {
public static void main(String[] args) {
// Convert a Word document to Markdown
String markdown = MarkdownConverter.toMarkdown("business-plan.docx");
// Or save directly to a file
MarkdownConverter.toFile("business-plan.docx", "qs-word-to-md.md");
}
}
business-plan.docx is a sample file used in this example. Click here to download it.

**Meridian Outdoor Co. — Business Plan**
FY2026 Strategic Plan
# **Table of Contents**
FY2026 Strategic Plan 1
[TRUNCATED]
Save a PDF to Markdown with images extracted to a folder:
import com.groupdocs.markdown.*;
public class QsPdfWithImages {
public static void main(String[] args) {
ExportImagesToFileSystemStrategy strategy =
new ExportImagesToFileSystemStrategy("output/images");
strategy.setImagesRelativePath("images");
DocumentConvertOptions options = new DocumentConvertOptions();
options.setImageExportStrategy(strategy);
MarkdownConverter.toFile("business-plan.pdf", "output/report.md", options);
// Images saved to output/images/
// Markdown references: 
}
}
business-plan.pdf is a sample file used in this example. Click here to download it.
output/images/img-001.jpg (10 KB)
output/images/img-002.jpg (39 KB)
output/images/img-003.jpg (25 KB)
output/images/img-004.jpg (16 KB)
output/images/img-005.jpg (44 KB)
output/images/img-006.jpg (20 KB)
output/images/img-007.jpg (648 bytes)
output/images/img-008.jpg (48 KB)
output/report.md (7 KB)
Convert a spreadsheet with column truncation and front matter:
import com.groupdocs.markdown.*;
public class QsExcelOptions {
public static void main(String[] args) {
DocumentConvertOptions options = new DocumentConvertOptions();
options.setMaxColumns(8);
options.setMaxRows(50);
options.setIncludeFrontMatter(true);
options.setFlavor(MarkdownFlavor.GITHUB);
try (MarkdownConverter converter = new MarkdownConverter("cost-analysis.xlsx")) {
// Inspect before converting
DocumentInfo info = converter.getDocumentInfo();
System.out.println("Worksheets: " + info.getPageCount());
// Convert
DocumentConvertResult result = converter.convert("qs-excel-options.md", options);
// Check warnings
for (String w : result.getWarnings()) {
System.out.println("Warning: " + w);
}
}
}
}
cost-analysis.xlsx is a sample file used in this example. Click here to download it.
---
format: XLSX
pages: 4
---
## Summary
| Category | FY2024 | FY2025 | FY2026 |
| --- | --- | --- | --- |
[TRUNCATED]
- Supported document formats — full list of input formats
- Image handling strategies — Base64, file system, skip, custom
- Markdown flavor control — GitHub vs CommonMark
- YAML front matter — for static site generators
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.