GroupDocs.Markdown for Java overview
Leave feedback
On this page
GroupDocs.Markdown is a Java library that converts documents from 20+ formats (PDF, Word, Excel, EPUB, TXT, CHM) into clean, structured Markdown. It uses a custom DOM-based renderer that gives full control over every aspect of the output.
Designed for AI/ML workflows, static site generators, and document processing pipelines — Markdown is the ideal format for language models, text analysis tools, and content management systems.
| Capability | Description |
|---|---|
| 20+ input formats | PDF, DOCX, DOC, XLSX, XLS, CSV, EPUB, MOBI, TXT, CHM, RTF, ODT, and more |
| Markdown flavors | GitHub Flavored Markdown or CommonMark |
| Image handling | Base64 embed, file system, skip, or custom with relative paths and image replacement |
| YAML front matter | Auto-extract metadata for Jekyll, Hugo, Docusaurus |
| Document inspection | Read format, pages, title, author without converting |
| Spreadsheet control | Column/row truncation, sheet separators, hidden sheet filtering |
| Heading offset | Shift heading levels for content embedding |
| Async API | Non-blocking conversion for web and serverless |
| Error handling | Specific exception types and conversion warnings |
import com.groupdocs.markdown.*;
public class QuickExample {
public static void main(String[] args) {
// One-liner
String md = MarkdownConverter.toMarkdown("business-plan.docx");
// # Quarterly Report
//
// ## Executive Summary
//
// This report covers the key initiatives...
// With options
DocumentConvertOptions options = new DocumentConvertOptions();
options.setFlavor(MarkdownFlavor.GITHUB);
options.setIncludeFrontMatter(true);
options.setHeadingLevelOffset(1);
MarkdownConverter.toFile("business-plan.docx", "quick-example.md", options);
}
}
business-plan.docx is a sample file used in this example. Click here to download it.
---
title: "Meridian Outdoor Co. — Business Plan"
author: "Meridian Outdoor Co."
format: DOCX
pages: 5
---

**Meridian Outdoor Co. — Business Plan**
[TRUNCATED]
- Windows, Linux, macOS
- Java SE 8 and above
- One JAR for every platform — no native dependencies
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.