Convert Excel to HTML
using IronXL;
using IronXL.Options;

WorkBook workBook = WorkBook.Load("sample.xlsx");

var options = new HtmlExportOptions()
{
    // Set row/column numbers visible in html document
    OutputRowNumbers = true,
    OutputColumnHeaders = true,

    // Set hidden rows/columns visible in html document
    OutputHiddenRows = true,
    OutputHiddenColumns = true,

    // Set leading spaces as non-breaking
    OutputLeadingSpacesAsNonBreaking = true
};

// Export workbook to the HTML file
workBook.ExportToHtml("workBook.html", options);
NuGet Download
PM > Install-Package IronXL.Excel
Convert Excel to HTML

Convert Excel to HTML

The code example above demonstrates how to convert Excel to HTML using C#. The HtmlExportOptions class is used to customize how the HTML output is generated. The available options are:

  • OutputRowNumbers property: Indicates whether to show row numbers in the resulting HTML file.
  • OutputColumnHeaders property: Indicates whether to show column headers in the resulting HTML file.
  • OutputHiddenRows property: Indicates whether to display hidden rows in the resulting HTML file.
  • OutputHiddenColumns property: Indicates whether to display hidden columns in the resulting HTML file.
  • OutputLeadingSpacesAsNonBreaking property: Indicates whether to show leading spaces (extra spaces before the first character in a cell) as non-breaking spaces in the resulting HTML file.
Discover more Excel file type conversions with IronXL.
View on GitHub

Ready to Get Started?

Nuget Downloads 2,362,812Version:2026.11just released