A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET.
dotnet add package Markdig
Available on NuGet — .NET Standard 2.0+
Try Markdig live with the public API. Edit Markdown, pick extensions, and click Run (or press Ctrl+Enter).
MarkdownPipelineBuilder.Configure(...) on the remote playground service.
<h1>Markdig Playground</h1>
<p>Markdig is a <strong>fast</strong> and extensible Markdown processor for .NET.</p>
Markdig is a fast and extensible Markdown processor for .NET.
Regex-free parser and HTML renderer with minimal GC pressure. 20% faster than the reference C implementation (cmark) and 100× faster than regex-based processors.
Passes 600+ tests from the latest CommonMark specification (0.31.2). Full support for all core Markdown constructs including GFM fenced code blocks.
Tables, task lists, math, diagrams, footnotes, emoji, alert blocks, abbreviations, and more — all included out of the box. Enable them individually or all at once.
Pluggable architecture — even core parsing is customizable. Create your own block parsers, inline parsers, and renderers with a clean API.
Full abstract syntax tree with precise source locations. Power syntax highlighters, editors, and document analysis tools with the complete Descendants API.
Parse with trivia tracking for lossless parse → render roundtrips. Modify Markdown documents programmatically without introducing unwanted changes.
using Markdig;
// Simple CommonMark conversion
var result = Markdown.ToHtml("This is a text with some *emphasis*");
// => "<p>This is a text with some <em>emphasis</em></p>\n"
// Enable all advanced extensions
var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
var result = Markdown.ToHtml("This is a ~~strikethrough~~", pipeline);
// => "<p>This is a <del>strikethrough</del></p>\n"
For more examples, see the Getting started guide.