Key Features
Text to HTML
RTF to Text
Download trial
What's New
Tutorials & Videos
How to create HTML email with embedded images from RTF and send it using Outlook in .Net C#.
How to convert RTF to HTML email with embedded images and send it via SmtpClient in .Net C#.
Converting RTF to HTML under Windows Azure.

"How to convert RTF to HTML in C# and .Net"

How to convert RTF to HTML in C# and .Net. Various examples.


     With the help of "RTF to HTML .Net", any .Net application can easily convert RTF documents to HTML and XHTML format. For example, to convert a RTF to HTML in C# you will only need to add a reference to the .dll and type a few lines of code:
            SautinSoft.RtfToHtml r = new SautinSoft.RtfToHtml();
            r.OpenRtf(@"c:\Quiet Flows the Don.rtf");
            r.OutputFormat = SautinSoft.RtfToHtml.eOutputFormat.HTML_5;
            r.ToHtml(@"c:\Quiet Flows the Don.html");   
The library gives you a full set of API to convert RTF to HTML. Furthermore, during conversion to HTML you may adjust following:
  • Various output format: HTML 3.2, HTML 4.01, HTML 5, XHTML, Text.
  • Generating output document in plain HTML 3.2 without CSS.
  • Whether to store images on filesystem or embed them into HTML document using base64 encoding.
  • Save CSS data between tags <style>...</style> or as inline styles <tag style="...">.
  • Specify encoding of output HTML.
  • Set up document Title; create only the part of HTML between <body>...</body> tags.
  • Set up a common font, size and color for a whole document.
  • Detect hyperlinks from text and make them real hyperlinks.
  • Override the table borders visibility.

Nuget   Online Demo   Download, (Sep 4th, 2017)

Have a Question?

You have a question, need a support or a code example: ask our support team at We will help you quickly and with pleasure.

What "RTF to HTML .Net" can give me:

  1. Save time and cost of the product development. The writing of own RTF to HTML converter in C# requires a lot of days of hard work and takes approx 50 000 C# code lines. "RTF to HTML .Net" will save a lot of my time and I'll need only to add the reference to "SautinSoft.RtfToHtml.dll" and write 3-4 C# code lines.

  2. The one product provides me by set of API to convert Text, DOCX and RTF document at various formats at once: HTML 3.2, 4.01, HTML5 and XHTML with CSS.

  3. Because of this is absolutely standalone .Net assembly, my clients don't need to have MS Word, Internet Explorer or other software.

  4. My software will produce well-formed HTML compatible with all W3C standards, you may check this.

  5. The one time price. I pay a one time and can use «RTF to HTML .Net» for a whole life without any additional fees. My license will never expires.

  6. As bonus, I get unlimited technical support during a whole life for free and independently of the date of my purchasing.

Some examples to convert RTF to HTML in C# and VB.Net

1. Convert RTF file to HTML file in C#:

			SautinSoft.RtfToHtml r = new SautinSoft.RtfToHtml();
            string rtfFile = @"d:\The Gift.rtf";
            string htmlFile = Path.ChangeExtension(rtfFile, ".html");

            r.OutputFormat = SautinSoft.RtfToHtml.eOutputFormat.HTML_5;
            if (r.ToHtml(htmlFile)==true)
                // Open HTML in browser.
2. Convert RTF to HTML in memory using C#; store images inside HTML using base-64.
			SautinSoft.RtfToHtml r = new SautinSoft.RtfToHtml();
            string rtfFile = @"d:\The Gift.rtf";
            string rtfString = File.ReadAllText(rtfFile);

            // Let's store all images inside the HTML document.
            r.ImageStyle.IncludeImageInHtml = true;

            string htmlString = r.ConvertString(rtfString);
3. Convert RTF to HTML in VB.Net; make all CSS styles inline, i.e. put within the attribute style="...".
            Dim r As New SautinSoft.RtfToHtml()

            ' Set HTML5 format.
            r.OutputFormat = SautinSoft.RtfToHtml.eOutputFormat.HTML_5
            ' Set utf-8 encoding.
            r.Encoding = SautinSoft.RtfToHtml.eEncoding.UTF_8
            ' Make all CSS inline.
            r.TextStyle.InlineCSS = True

            Dim rtfFile As String = "e:\Petersburg.rtf"
            Dim htmlFile As String = Path.ChangeExtension(rtfFile, ".html")
            r.ConvertFile(rtfFile, htmlFile)
4. Convert RTF to HTML in C#; get the list with all images from RTF.
			SautinSoft.RtfToHtml r = new SautinSoft.RtfToHtml();
            string rtfFile = @"d:\The Gift.rtf";
            string rtfString = File.ReadAllText(rtfFile);

            // Let's store all images inside the HTML document.
            r.ImageStyle.IncludeImageInHtml = true;

            List<RtfToHtml.SautinImage> listImages = new List<RtfToHtml.SautinImage>();
            string htmlString = r.ConvertString(rtfString, listImages);

            // Let's loop and and save all images to hdd.
            int count = 1;
            foreach (RtfToHtml.SautinImage img in listImages)
                img.Img.Save(String.Format(@"d:\image{0}.png", count));
If anyone needs a code sample in C#, VB.Net, ASP.Net etc "How to convert RTF to HTML", email us at or ask at Online Chat (right-bottom corner of this page). We'll help you certainly!

Requrements and Technical Information

     «RTF to HTML .Net» can be used on 32 and 64-bits platforms with .Net 2.0 and higher. The component doesn't require Internet Explorer, Microsoft Office or any other software. It's absolutely standalone and independent library.

The DOCX conversion works starting from .Net 4.0. If you are looking for a standalone C# library to create and parse Word documents, try our Document .Net.

Our product is compatible with all .Net languages and supports all Operating Systems where .Net Framework can be used. Note that «RTF to HTML .Net» is entirely written in managed C#.

Reasonable prices

     The library offers developers high quality conversion at reasonably prices. The main point of interest is that «RTF to HTML .Net» is less expensive than all of its more or less popular counterparts. For example, a single license cost $339 with no additional fees or royalties!


To see this functionality firsthand, download the freshest «RTF to HTML .Net» with code examples, 11.5 Mb.

Products Downloads Support Company
Buy now
Follow us on Google Plus SautinSoft on Facebook SautinSoft on Twitter SautinSoft on Youtube Our Blog
Copyright © 2002 - 2018 SautinSoft (started from All rights reserved.