Convert web pages and HTML to Markdown from .NET
The HTML to Markdown Converter loads a web page or an HTML string with its CSS and JavaScript, the same way the HTML to PDF Converter does, then writes the content as Markdown text with headings, lists, tables, code blocks, links and images. The result is easy to store, to index and to pass to AI tools. The library targets .NET Standard 2.0 and runs on Windows, Linux and macOS, including Azure App Service, Azure Functions and Docker.
Version 15.1.0. Building EVO PDF libraries since 2010. Evaluate without registration; the demo output is watermarked until you set a license key. Part of the HTML to PDF Converter component.
Documentation · Samples and demos on GitHub · AI agent skills
dotnet add package EvoPdf.Next.HtmlToPdf.Windows
This is the Windows package; EvoPdf.Next.HtmlToPdf.Linux and EvoPdf.Next.HtmlToPdf.MacOS work the same way, or use the all-components EvoPdf.Next.* metapackage for your platform. This component ships in the HTML to PDF Converter package.
using EvoPdf.Next; var converter = new HtmlToMarkdownConverter(); // a web page given by its URL string markdown = converter.ConvertUrl( "https://www.example.com"); // or an HTML string with a base URL string fromHtml = converter.ConvertHtml( htmlString, "https://www.example.com/");
- Windows 10, 11 and Windows Server 2016 to 2025 (x64 and ARM64)
- Linux 64-bit distributions (x64 and ARM64)
- macOS 12.0+ (Apple Silicon / ARM64)
- .NET 11.0, 10.0, 9.0, 8.0, 7.0, 6.0, .NET Standard 2.0
- .NET Framework 4.6.2 to 4.8.1
- Azure App Service, Functions and Container Apps
- AWS Elastic Beanstalk, Lambda and ECS
- Google Cloud Run and Kubernetes
- Web, console and desktop applications
Choose what goes into the Markdown
Navigation bars, footers and banners are rarely wanted in the result. A CSS selector picks the part of the page to convert and another one leaves elements out. The images can be written as links, with the source they have in the page, embedded in the text or left out.
Pages that fill their content from JavaScript are converted after a delay or after an element given by a CSS selector is present. Convert HTML to Markdown: documentation →
using EvoPdf.Next; var converter = new HtmlToMarkdownConverter(); // only the article, without its side notes converter.ConvertedElementsSelector = "article"; converter.ExcludedElementsSelector = "aside, nav"; // embed the images and wait for the content converter.ImageMode = MarkdownImageMode.Embed; converter.WaitForSelector = "#content-loaded"; string markdown = converter.ConvertUrl(url);
What the HTML to Markdown component does
- Convert a web page from a URL or an HTML string to Markdown
- Return the Markdown as a string or write it to a file
- Headings, paragraphs, lists, tables, code blocks and quotes
- Links written as Markdown links, or only their text
- Images written as links, left out or embedded in the text
- Convert only a part of the page selected with a CSS selector
- Leave elements out of the result with a CSS selector
- Wait for a delay or for an element before the conversion starts
- Images that load lazily are loaded before the conversion
- Asynchronous methods that can be used with async and await
NuGet packages
Reference EvoPdf.Next.HtmlToPdf.Windows, .Linux, .MacOS or the .Arm64 variants, or the EvoPdf.Next.* metapackage for your platform, which includes every component.
dotnet add package EvoPdf.Next.HtmlToPdf.Windows
On nuget.org: EvoPdf.Next.HtmlToPdf.Windows · .Linux · .MacOS · .Windows.Arm64 · .Linux.Arm64 · metapackage EvoPdf.Next
EvoPdf.Next.HtmlToPdf packages), together with HTML to PDF and HTML to Image.Install and run on Windows, Linux and macOS
The HTML to Markdown Converter runs on the platform-specific runtime of the HTML to PDF Converter, which comes inside the NuGet package. Windows and macOS need nothing else. On Linux a few system packages may be required, depending on the distribution and Getting Started on Linux lists them.
Windows
Windows 10, 11 and Windows Server 2016–2025, x64 and ARM64. No additional dependencies.
Getting Started on Windows →Linux
64-bit distributions, x64 and ARM64. The guide lists the system packages per distribution.
Getting Started on Linux →macOS
macOS 12 and later on Apple Silicon (ARM64). No additional dependencies.
Getting Started on macOS →Docker
Complete Dockerfiles for Linux (x64, ARM64) and Windows Server containers, with the runtime dependencies and the build commands.
Docker page →Azure
App Service and Functions on Windows and Linux, from code or a container image, Container Apps and AKS: plan sizing and the Linux setup.
Azure page →AWS
Elastic Beanstalk on Amazon Linux 2023 and Windows Server, Lambda functions and ECS on Fargate: the configuration file, the Dockerfiles, sizing.
AWS page →Google Cloud
Cloud Run services in both execution environments and GKE: the Dockerfile, Artifact Registry, the deploy command, sizing.
Google Cloud page →Covered by the HTML to PDF license
HTML to Markdown is part of the HTML to PDF Converter component and uses its license. The EVO PDF Toolkit license covers it too, together with every other component on this site, Next and Classic.









