Convert documents to Markdown with GroupDocs.Markdown
Leave feedback
On this page
GroupDocs.Markdown converts documents into structured Markdown — headings, lists, tables and images — that you can hand to a static site or a language model. MarkdownConverter reads the source and either returns a string or writes a .md file.
Import the package first, so the Total library is on the classpath, then load MarkdownConverter with java.import. Every example below is ready to copy into a project once you have installed the package.
Convert Word to Markdown
toFile writes the Markdown next to the name you give it. toMarkdown returns the same result as a string when you want to keep it in memory.
business-plan.docx is the 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]
Images are embedded in the Markdown as Base64. The product guide shows how to write them to a folder instead, and how to pick GitHub Flavored Markdown or CommonMark.
Convert PDF to Markdown
The same call works for PDF. Only the source file changes.
business-plan.pdf is the sample file used in this example. Click here to download it.
**Meridian Outdoor Co. — Business Plan**
FY2026 Strategic Plan

**Table of Contents**
MeridianOutdoorCo.—BusinessPlan.........................................................................................1
[TRUNCATED]
GroupDocs.Markdown also converts spreadsheets, presentations, email, ebooks and plain text, limits how many spreadsheet rows and columns are exported, shifts heading levels, and can add YAML front matter from the document metadata.