Word .NET > Tutorial > Export Word document to Markdown

The following example shows you how to export a Word document to Markdown format. The SaveAsMarkdown method converts document content to GitHub Flavored Markdown (GFM), preserving headings, text formatting, tables, hyperlinks, lists, and other elements.

C# example - Export existing document
C# example - Get Markdown as string
VB example

Features supported in Markdown export:

  • Headings (H1-H6 mapped from Word heading styles)
  • Bold, italic, bold+italic, strikethrough formatting
  • Hyperlinks with URLs
  • Tables (GFM pipe table format with column alignment)
  • Numbered and bulleted lists
  • Blockquotes (from Quote styles)
  • Code formatting (from monospace fonts)
  • Superscript and subscript (using HTML tags)
  • Footnotes and endnotes
  • Page breaks (as horizontal rules)

Need help? Ask our developers: