All formats

Markdown libraries

Markdown parsers convert Markdown to HTML and most also expose a syntax tree. Prefer a CommonMark-compliant parser: it gives the same result as other compliant tools for the core syntax. Check which GFM features (tables, task lists, strikethrough, autolinks) and other extensions (footnotes, front matter, heading IDs) you need, and whether raw HTML is escaped by default when you render untrusted input.

Language Library CommonMark GFM Notes
C/C++ cmark yes no the CommonMark reference implementation, C, very fast
C/C++ cmark-gfm yes yes GitHub’s fork of cmark, used to render github.com
C/C++ MD4C yes yes small SAX-style C parser, no AST, used by Qt
C# Markdig yes yes the standard .NET parser, 20+ extensions, roundtrip AST
Java commonmark-java yes yes (extensions) small core, extension modules, Markdown renderer
Java flexmark-java yes yes many extensions, HTML-to-Markdown, DOCX/PDF export
Go goldmark yes yes used by Hugo, extensible, standard library only
Python markdown-it-py yes yes (plugins) port of markdown-it, token stream, used by MyST and Jupyter
Python Python-Markdown no partly (extensions) used by MkDocs, many extensions, original Markdown rules
Python mistune mostly yes (plugins) fast pure Python, AST output, plugins
Ruby commonmarker yes yes Ruby binding of comrak (Rust), syntax highlighting
Ruby kramdown no with kramdown-parser-gfm Jekyll’s default, own dialect, many output formats
Ruby Redcarpet no partly fast C extension, custom renderers
Rust pulldown-cmark yes yes pull parser (event iterator), used by rustdoc and mdBook
Rust comrak yes yes port of cmark-gfm with an AST and many extensions
PHP league/commonmark yes yes the standard PHP parser, extensions, AST
PHP Parsedown no partly single file, fast, simple

By language#