ReverseMarkdown 6.2.1
Meet ReverseMarkdown

ReverseMarkdown is a HTML to Markdown converter library in C#. v6 uses AngleSharp's HTML5-compliant parser and a Markdown DOM pipeline for reliable, performant conversion.
📖 Full documentation: mysticmind.github.io/reversemarkdown-net
Using v5.x? See the v5.x documentation.
If you have used and benefitted from this library, please feel free to sponsor me!
Install
dotnet add package ReverseMarkdown
Quick start
var converter = new ReverseMarkdown.Converter();
string html = "This a sample <strong>paragraph</strong> from <a href=\"http://test.com\">my site</a>";
string result = converter.Convert(html);
// This a sample **paragraph** from [my site](http://test.com)
With configuration and a flavor:
var config = new ReverseMarkdown.Config
{
Flavor = Config.MarkdownFlavor.GitHub,
Formatting = { RemoveComments = true },
Links = { SmartHref = true },
};
var converter = new ReverseMarkdown.Converter(config);
Real-world HTML often needs cleaning up first. Config.Preprocess is a chainable pipeline applied
to the source markup before it converts:
var config = new ReverseMarkdown.Config();
config.Preprocess
.RemoveScripts() // <script>/<noscript> and on* handlers
.RemoveStyles() // style attributes, <style>, stylesheet <link>
.Remove("nav, footer, .advertisement") // drop page chrome
.Unwrap("span, font") // keep the text, lose the wrapper
.Rename("b", "strong");
var markdown = new ReverseMarkdown.Converter(config).Convert(html);
Features
- Seven output flavors - Default, GitHub, CommonMark, Slack, Telegram, MultiMarkdown, and Pandoc, selected via the
Flavorenum. - Spec-compliant round-trips - CommonMark and GitHub Flavored Markdown round-trip at 100% against canonical cmark-gfm; MultiMarkdown and Pandoc verified against canonical pandoc.
- HTML preprocessing - clean up the source before it converts with a chainable pipeline of 23 helpers: remove or unwrap elements, rename or replace them, strip styles, scripts and attributes, recover formatting from inline CSS (Word/Outlook exports), and resolve relative URLs. Plug in your own steps too. See HTML Preprocessing.
- Extensible - custom readers (
IMdReader+[MarkdownReader]), tag aliases, and aParse/RenderMarkdown DOM for direct transformation. - Tables, links, and images - nested tables and captions, configurable handling for lists inside table cells, smart href handling, URI-scheme whitelisting, and base64 image handling (include / skip / save to disk).
- Broad framework support - targets
netstandard2.0,net8.0,net9.0, andnet10.0(runs on .NET Framework 4.6.1+, .NET Core 2.0+, Mono, and Unity). - Trimming and Native AOT ready - the default conversion path uses no reflection; add custom readers with
RegisterReaderunder trimming/AOT. See Supported Frameworks.
Performance
v6 replaces the v5 HtmlAgilityPack engine with an AngleSharp HTML5 parser feeding a Markdown DOM and per-flavor writers. It is roughly 2–2.6× faster than v5 and allocates about 2.7× less memory.

Measured with BenchmarkDotNet on .NET 9.0 (Apple M1), comparing published ReverseMarkdown 5.5.0
vs 6.0.0 on the same inputs (lower is better):
| Fixture | Mean time v5 → v6 | Allocated v5 → v6 |
|---|---|---|
| 1000 paragraphs | 13.7 → 5.2 ms (2.6× faster) | 21 → 7 MB (2.8× less) |
| 10k paragraphs | 119.1 → 63.1 ms (1.9× faster) | 183 → 67 MB (2.7× less) |
| huge.html | 540.6 → 244.3 ms (2.2× faster) | 779 → 288 MB (2.7× less) |
See the Performance guide for details and how to reproduce the benchmark.
Documentation
The full guide lives at mysticmind.github.io/reversemarkdown-net:
- Getting Started
- Performance
- Flavors
- Configuration reference
- HTML Preprocessing
- Extending (custom readers, recipes)
- Migrating from v5
Acknowledgements
This library's initial implementation ideas from the Ruby based Html to Markdown converter xijo/reverse_markdown.
Copyright
Copyright © Babu Annamalai
License
ReverseMarkdown is licensed under the MIT License.
No packages depend on ReverseMarkdown.
.NET 10.0
- AngleSharp (>= 1.5.2)
.NET 8.0
- AngleSharp (>= 1.5.2)
.NET 9.0
- AngleSharp (>= 1.5.2)
.NET Standard 2.0
- AngleSharp (>= 1.5.2)
| Version | Downloads | Last updated |
|---|---|---|
| 6.2.1 | 1 | 08/16/2026 |
| 6.2.0 | 0 | 08/13/2026 |
| 6.1.1 | 3 | 07/28/2026 |
| 6.1.0 | 2 | 07/07/2026 |
| 6.0.0 | 4 | 07/06/2026 |
| 5.5.0 | 4 | 07/06/2026 |
| 5.4.0 | 4 | 06/14/2026 |
| 5.3.0 | 6 | 04/02/2026 |
| 5.2.1 | 6 | 04/04/2026 |
| 5.2.0 | 4 | 04/24/2026 |
| 5.1.0 | 5 | 04/24/2026 |
| 5.0.0 | 5 | 04/24/2026 |
| 4.7.1 | 4 | 04/24/2026 |
| 4.7.0 | 4 | 04/24/2026 |
| 4.6.0 | 5 | 04/24/2026 |
| 4.4.0 | 4 | 04/24/2026 |
| 4.3.0 | 4 | 04/24/2026 |
| 4.1.0 | 5 | 04/24/2026 |
| 4.0.0 | 6 | 04/24/2026 |
| 3.25.0 | 4 | 04/25/2026 |
| 3.24.0 | 5 | 04/25/2026 |
| 3.23.1 | 5 | 04/25/2026 |
| 3.23.0 | 5 | 04/25/2026 |
| 3.22.0 | 5 | 04/25/2026 |
| 3.21.0 | 4 | 04/25/2026 |
| 3.20.0 | 4 | 04/25/2026 |
| 3.19.0 | 5 | 04/25/2026 |
| 3.18.0 | 5 | 04/25/2026 |
| 3.17.0 | 5 | 04/25/2026 |
| 3.16.0 | 5 | 04/25/2026 |
| 3.15.0 | 5 | 04/25/2026 |
| 3.14.0 | 5 | 04/25/2026 |
| 3.13.0 | 5 | 04/25/2026 |
| 3.12.0 | 5 | 04/25/2026 |
| 3.11.0 | 5 | 04/24/2026 |
| 3.10.0 | 5 | 04/25/2026 |
| 3.9.0 | 4 | 04/24/2026 |
| 3.8.0 | 4 | 04/24/2026 |
| 3.7.0 | 3 | 04/24/2026 |
| 3.6.0 | 4 | 04/24/2026 |
| 3.5.0 | 5 | 04/24/2026 |
| 3.4.0 | 3 | 04/24/2026 |
| 3.3.0 | 4 | 04/24/2026 |
| 3.2.0 | 5 | 04/24/2026 |
| 3.1.0 | 4 | 04/24/2026 |
| 3.0.0 | 6 | 04/24/2026 |
| 2.1.0 | 4 | 04/24/2026 |
| 2.0.0 | 4 | 04/24/2026 |
| 1.5.0 | 4 | 04/24/2026 |
| 1.4.0 | 5 | 04/24/2026 |
| 1.3.0 | 4 | 04/24/2026 |
| 1.2.0 | 4 | 04/24/2026 |
| 1.1.0 | 5 | 04/24/2026 |
| 1.0.0 | 4 | 04/24/2026 |
| 1.0.0-beta1 | 5 | 04/25/2026 |
| 0.1.25 | 0 | 09/04/2016 |
| 0.1.22 | 0 | 04/18/2016 |
| 0.1.15 | 0 | 11/21/2015 |
| 0.1.12 | 0 | 07/16/2015 |
| 0.1.9 | 0 | 07/16/2015 |
| 0.1.8 | 0 | 07/07/2015 |
| 0.1.7 | 0 | 07/06/2015 |
| 0.1.6 | 0 | 07/06/2015 |
| 0.1.5 | 0 | 07/06/2015 |