If you pop-up NuGet and search for "RTF", the most popular result right now looks like RtfPipe; you can install it right there, or via the package manager console via:

Install-Package RtfPipe

Then in your C#, you can convert RTF to HTML super easily:

var html = RtfPipe.Rtf.ToHtml(rtf);

According to the readme.md on their GitHub page:

This library attempts to support the core RTF features documented in the RTF Specification 1.9.1. These features include:

  • Character formatting (bold, italics, color, ...)
  • Tables (including nested tables)
  • Lists
  • Hyperlinks
  • Pictures
  • Heading levels
  • HTML encapsulation (e.g. as performed by Outlook)

With that said, there are numerous cases for non-trivial documents where the library will not produce the "correct" visual representation when compared to other RTF readers (such as MS Word).

I piped my RTF into it, and it worked amazingly. YYMV.

Answer from BrainSlugs83 on Stack Overflow
Top answer
1 of 4
18

If you pop-up NuGet and search for "RTF", the most popular result right now looks like RtfPipe; you can install it right there, or via the package manager console via:

Install-Package RtfPipe

Then in your C#, you can convert RTF to HTML super easily:

var html = RtfPipe.Rtf.ToHtml(rtf);

According to the readme.md on their GitHub page:

This library attempts to support the core RTF features documented in the RTF Specification 1.9.1. These features include:

  • Character formatting (bold, italics, color, ...)
  • Tables (including nested tables)
  • Lists
  • Hyperlinks
  • Pictures
  • Heading levels
  • HTML encapsulation (e.g. as performed by Outlook)

With that said, there are numerous cases for non-trivial documents where the library will not produce the "correct" visual representation when compared to other RTF readers (such as MS Word).

I piped my RTF into it, and it worked amazingly. YYMV.

2 of 4
1

Disclaimer: I'm working for this company.

As I see, the question is old but maybe someone search solution for this too. Our component RTF to HTML allows to convert RTF to HTML. You may download a component or try online-demo. Try the trial version first if you have a doubt. :) Trial is free.

Here's the code sample for the converting from RTF to HTML in ASP.NET:

    SautinSoft.RtfToHtml r = new SautinSoft.RtfToHtml();
    r.OutputFormat = SautinSoft.RtfToHtml.eOutputFormat.HTML_401;
    r.ImageStyle.IncludeImageInHtml = false; //To save images inside HTML as binary data specify this property to 'true'

    r.ImageStyle.ImageFolder = Server.MapPath(""); 
    r.ImageStyle.ImageSubFolder = "images";
    r.ImageStyle.ImageFileName = "picture";       

    string rtf = ".....";
    string html = r.ConvertString(rtf);        

    //show HTML
    if (html.Length>0)
    {
        Response.Buffer = true;
        Response.Clear();
        Response.ContentType = "text/html";
        Response.Write(html);
        Response.Flush();
        Response.End();
    }
People also ask

Why convert RTF to HTML in C#?
Documents are encoded in many ways, and RTF files may be incompatible with some software. To open and read such files, just convert them to appropriate file format.
๐ŸŒ
products.aspose.com
products.aspose.com โ€บ aspose.words โ€บ .net โ€บ conversion โ€บ rtf to html in c#
Convert RTF to HTML in C#
How to convert RTF into HTML?
Open the site: RTF into HTML. Drag and drop RTF files to quickly convert them into HTML. Or just use a code sample in C# with a few lines of code.
  1. Install Aspose.Words for .NET.
  2. Add a library reference (import the library) to your C# project.
  3. Open the source RTF file in C#.
  4. Call the Save() method, passing an output filename with HTML extension.
  5. Get the result of RTF conversion as HTML.
๐ŸŒ
products.aspose.com
products.aspose.com โ€บ aspose.words โ€บ .net โ€บ conversion โ€บ rtf to html in c#
Convert RTF to HTML in C#
What other file formats can I convert my RTF to?
We support a variety of file formats for RTF conversion, including DOCX, ODT, PDF, DOC, HTML, RTF, Markdown, XML, JPG, PNG, TIFF, WPS, TXT and many more.
๐ŸŒ
products.aspose.com
products.aspose.com โ€บ aspose.words โ€บ .net โ€บ conversion โ€บ rtf to html in c#
Convert RTF to HTML in C#
๐ŸŒ
ConvertAPI
convertapi.com โ€บ rtf-to-html
RTF to HTML Conversion API โ€“ Clean, Semantic HTML from RTF
Convert RTF to HTML via API. Preserves structure and images. Fast, reliable, no MS Office required.
๐ŸŒ
CloudConvert
cloudconvert.com โ€บ rtf-to-html
RTF to HTML | CloudConvert
>RTF to HTML Converter - CloudConvert is a free & fast online file conversion service.
๐ŸŒ
Word to HTML
wordtohtml.net โ€บ convert โ€บ rtf-to-html
Convert RTF to HTML online for free
Upload a RTF document by clicking the blue Upload button or simply drag and drop your document into the white area above. ... download it as a file (it can be either an HTML file if your document does not have any images or a ZIP file with all the images in it) ... In addition to converting RTF documents to HTML, WordToHTML.net also supports the conversion of other file formats such as WORD (DOCX/DOC), PDF, ODT, HTML and TXT.
๐ŸŒ
GitHub
github.com โ€บ SautinSoft โ€บ SautinSoft.RtfToHtml.Examples
GitHub - SautinSoft/SautinSoft.RtfToHtml.Examples: RTF to HTML .Net is a standalone C# assembly to convert Text, DOCX, RTF documents into HTML/XHTML documents with CSS.
RTF to HTML .Net is a standalone C# assembly to convert Text, DOCX, RTF documents into HTML/XHTML documents with CSS. - SautinSoft/SautinSoft.RtfToHtml.Examples
Author ย  SautinSoft
๐ŸŒ
Softinterface
softinterface.com โ€บ Convert-Doc โ€บ Features โ€บ Convert-RTF-To-HTML.htm
Convert Doc - Feature (RTF to HTML)
File Type Constants SpecificationFile_Type_Constants_Specification for the 'Convert Doc' method will show that the numeric value of 5 corresponds to a RTF file. /C4 is the output file type, which in this case is a HTML file.
Find elsewhere
๐ŸŒ
GNU
gnu.org โ€บ software โ€บ unrtf
UnRTF - GNU Project - Free Software Foundation (FSF)
UnRTF is a command-line program written in C which converts documents in Rich Text Format (.rtf) to HTML, LaTeX, troff macros, and RTF itself.
๐ŸŒ
e-iceblue
e-iceblue.com โ€บ Tutorials โ€บ Spire.Doc โ€บ Spire.Doc-Program-Guide โ€บ How-to-Use-C- โ€บ VB.NET-to-Convert-RTF-to-HTML-via-Spire.Doc.html
C#: Convert RTF to HTML, Image
With Spire.Doc for .NET, you can achieve RTF to HTML conversion through the Document.SaveToFile(string fileName, FileFormat.Html) method.
๐ŸŒ
Img2html
img2html.com โ€บ blog โ€บ c-converting-rtf-to-html
C Converting Rtf To Html
Welcome to Img2HTML, the service that transforms images into HTML pages. Simply upload your image and we'll send you back the HTML version. We offer fast, accurate conversion with a wide range of options to customize the output. Try it out now and see how easy it is to turn your images into HTML
๐ŸŒ
W3C
w3.org โ€บ Tools โ€บ HTMLGeneration โ€บ rtf2html.html
RTF to HTML Converter
Several people mentioned that it'd be nice to have some way to convert RTF (Rich Text Format) files into HTML. Well, here's a first shot at it. It's not pretty, but rtf2html will convert MS Word documents using a specific style sheet into HTML.
๐ŸŒ
Experts Exchange
experts-exchange.com โ€บ articles โ€บ 3096 โ€บ Convert-RTF-to-HTML-and-HTML-to-RTF.html
Convert RTF to HTML and HTML to RTF | Experts Exchange
February 8, 2026 - This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use...
๐ŸŒ
Convertio
convertio.co โ€บ rtf-html
RTF to HTML (Online & Free) โ€” Convertio
Best way to convert your RTF to HTML file in seconds. 100% free, secure and easy to use! Convertio โ€” advanced online tool that solving any problems with any files.
Top answer
1 of 4
24

Create a WebBrowser. Load it with the html content. Select all and copy from it. Paste into a richtextbox. Then you have the RTF

string html = "...."; // html content
RichTextBox rtbTemp = new RichTextBox();
WebBrowser wb = new WebBrowser();
wb.Navigate("about:blank");

wb.Document.Write(html);
wb.Document.ExecCommand("SelectAll", false, null);
wb.Document.ExecCommand("Copy", false, null);

rtbTemp.SelectAll();
rtbTemp.Paste();

Now rtbTemp.RTF has the RTF converted from the HTML.

2 of 4
13

TL;DR: I recommend using the OpenXml format and the HtmlToOpenXml nuget package if possible.


Microsoft Word COM

I haven't really searched much into this topic as a my use case is to use the functionality on a server which makes COM components not a great selection.


XHTML2RTF

As @IAmTimCorey mentioned you can use this codeproject library.

Disadvantages are:

  • Limited supported HTML and CSS
  • Not really .NET
  • ...

Windows Forms Web Browser

As @Jerry mentioned you can use the Windows Forms WebBrowser control.

Disadvantages are:

  • Reference to System.Windows.Forms
  • Uses copy & paste (problematic for multithreading)
  • Only works in an STA thread

Not supported features include:

  • Fonts
  • Colors
  • Numbered lists
  • Strikethrough (del element)
  • ...

DevExpress

Code sample of "Paul V" from the devexpress support center. (03.02.2015)

public String ConvertRTFToHTML(String RTF)
{   
    MemoryStream ms = new MemoryStream();
    StreamWriter writer = new StreamWriter(ms);
    writer.Write(RTF);
    writer.Flush();
    ms.Position = 0;
    String output = "";
    HtmlEditorExtension.Import(HtmlEditorImportFormat.Rtf, ms, (s, enumerable) => output = s);

    return output;
}

public String ConvertHTMLToRTF(String Html)
{
    MemoryStream ms = new MemoryStream();
    var editor = new ASPxHtmlEditor { Html = html };

    editor.Export(HtmlEditorExportFormat.Rtf, ms);

    ms.Position = 0;
    StreamReader reader = new StreamReader(ms);

    return reader.ReadToEnd();
}

Or you could use the RichEditDocumentServer type as shown in this example.

  • A license for devexpress can cost from around 1500.- USD to 2200.- USD.

Unknown what actually is supported.

Disadvantages are:

  • Price
  • Quite a lot of references for one small thing
  • More?

Not supported features include:

  • Striketrough (del element)

Sautinsoft

public string ConvertHTMLToRTF(string html)
{
    SautinSoft.HtmlToRtf h = new SautinSoft.HtmlToRtf();
    return h.ConvertString(htmlString);
}

public string ConvertRTFToHTML(string rtf)
{
    SautinSoft.RtfToHtml r = new SautinSoft.RtfToHtml();
    byte[] bytes = Encoding.ASCII.GetBytes(rtf);
    r.OpenDocx(bytes );
    return r.ToHtml();
}

More examples and configuration options can be found here and here.

  • A licence for this component can cost from 400.- USD to 2000.- USD.

Supported is the following:

  • HTML 3.2
  • HTML 4.01
  • HTML 5
  • CSS
  • XHTML

Disadvantages are:

  • I'm not sure how active the development is
  • Price

Usage knowledgebase:

  • Converting numbered lists from the trix angular editor destroys indend

DIY

If you only wanted to support limited functionality you could write your own converter. I would not recommend this if the supported feature set is too large. (Sautinsoft claims to have written over 20'000 lines of code).

I have a small sample project here but is only for educational purposes in its current state.


OpenXml

If the OpenXml format is also ok for your use case you can use the HtmlToOpenXml nuget package. Its free and did support all features I've tested the other solutions against.

The project is based on the Open Xml SDK by microsoft and seems active.

public static byte[] ConvertHtmlToOpenXml(string html)
{
    using (var generatedDocument = new MemoryStream())
    {
        using (var package = WordprocessingDocument.Create(generatedDocument, WordprocessingDocumentType.Document))
        {
            var mainPart = package.MainDocumentPart;
            if (mainPart == null)
            {
                mainPart = package.AddMainDocumentPart();
                new Document(new Body()).Save(mainPart);
            }

            var converter = new HtmlConverter(mainPart);
            converter.ParseHtml(html);

            mainPart.Document.Save();
        }

        return generatedDocument.ToArray();
    }
}

  • Link to example gist
๐ŸŒ
Aspose
products.aspose.app โ€บ words โ€บ conversion โ€บ rtf to html
Convert RTF To HTML Online - Aspose Products
To convert RTF document to HTML, simply drag and drop a RTF file into the data upload field, specify the conversion options, click the 'Convert' button, and get your output HTML file in seconds.
๐ŸŒ
Word to HTML
wordtohtml.net
Convert Word and PDF files to clean HTML | Free online HTML editor
Enter or paste your text or upload and convert your Word (DOCX, DOC), PDF, ODT, RTF, and TXT documents to clean HTML.